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 < "2023-02-25 05:09:42";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 08:39:42", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 08:39:42', '4', '', '197.61.10.130', '', 'DESKTOP');
UPDATE programsettings SET companyname = 'GT4', address = 'المنصورة', specializtion = 'jh', phone = '01002019235', faxnumber = '0502232923', email = 'mrabozied@gt4it.com', website = 'www.gt4host.com', logo = '471502e62c0be89a8d90663028144a83.jpg', roundnumbers = '0', saveprinting = '1', deptprinting = '0', printingpapersize = '0', userid = '1', showPreviousPrice = '0', parcode = '0', priceing = '0', lastprice = '0', searchvalue = '1', 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 = '2023-02-25',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='9c2d4cf4cf5d4e24d5070164705832c3a5d1287f641a2960e48e04ae57a2ad0a5441322ca7cf34efd63003fdb348adbd0b61197c7c87d8dd5bc298c352482bc6',allowdateedit = '0', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='1' , date='1' , limitamount = '0' , 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 = '0' ,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='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0' 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;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 05:09:43";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 06:19:35";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 09:49:35", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 09:49:35', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 06:19:53";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 09:49:53", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 09:49:53', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 06:31:05";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 10:01:05", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 10:01:05', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:13:42";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 10:43:42", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 10:43:42', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:15:09";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 10:45:09", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 10:45:09', '4', 'addAndRetuen', '197.61.10.130', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063f9ca3e482ff
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 10:43:42', '063f9ca3e482ff', '1', '0.00', '0', '200', '1', '1400', '1200', '1200', '0', '7', '2023-02-25 10:45:09', '', '4', '0', 'نقدي', '7', '0', '3', '0', 'نقدي', '8' ,'0','','','','','-1','0','0','0','0','0','1200','0','','0','0','1200','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '4' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10360', '0', '2023-02-25 10:45:09', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1200', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 1480;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 2622;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('190','00382', '10360', '1', '382', '8', '175', '1400', '0', '', '0', '2023-02-25 10:45:09', '382', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','1480-6,2622-2,');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 172.50, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 172.50
                where sellbilldetailid = 30214;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (382, '2023-02-25', 1200, 1400, 1520
                    , 1380, 1520, 1380, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 1200, 1400, 1520
                    , 1380, 1520, 1380, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '19', userid = '4', storedetaildate = '2023-02-25 10:45:09' WHERE storedetailid = '1291';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('382', '7', '8', '1', '10360', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27.00', '19', '4', '2023-02-25 10:45:09','0','0');
UPDATE save SET  savecurrentvalue = '1200',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('0.00','1200', '0', '7', 'اضافة فاتورة مبيعات', '10360', '1200', '2023-02-25 10:45:09', '4',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 1200, 1400, 1520
                    , 1380, 1520, 1380, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 1200, 1400, 1520
                    , 1380, 1520, 1380, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1200, sellCostBuyPrice =sellCostBuyPrice+1400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 1200, 1400, 1520
                    , 1380, 1520, 1380, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1200, netSellCostBuyPrice = netSellCostBuyPrice+1400
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1520
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1380
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1520
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1380
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063f9ca3e482ff and sellbillId = 10360 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:15:09";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 10:45:10", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 10:45:10', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:15:12";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 10:45:12", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 10:45:12', '4', '', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:15:14";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 10:45:14", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 10:45:14', '4', 'showDetail', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:15:23";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 10:45:23", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 10:45:23', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
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 < "2023-02-25 07:22:49";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 10:52:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 10:52:49', '1', '', '156.210.14.93', '', 'DESKTOP');
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 < "2023-02-25 07:22:49";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:24:06";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 10:54:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 10:54:06', '1', '', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:24:13";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 10:54:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 10:54:13', '1', 'showDetail', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:33:55";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 11:03:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientController.php', '2023-02-25 11:03:55', '1', 'showByType', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:35:38";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 11:05:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientController.php', '2023-02-25 11:05:38', '1', 'tempdelete', '156.210.14.93', '', 'DESKTOP');
UPDATE client SET conditions = 1
		        WHERE clientid =311 ;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:35:38";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 11:05:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientController.php', '2023-02-25 11:05:38', '1', 'sucess', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:35:40";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 11:05:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientController.php', '2023-02-25 11:05:40', '1', 'show', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:40:30";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 11:10:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:10:30', '1', 'addsellBill', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:40:58";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 11:10:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('currencyController.php', '2023-02-25 11:10:58', '1', 'show', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:41:15";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 11:11:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientController.php', '2023-02-25 11:11:15', '1', 'show', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:41:46";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 11:11:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientController.php', '2023-02-25 11:11:46', '1', 'deleteFinaly', '156.210.14.93', '', 'DESKTOP');
UPDATE accountstree SET name = 'ابو مريم ', customName = 'ابو مريم ', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '1', userid = '4', mydate = '2022-03-26', itemtype2 = '1', theValue = '-43100.00', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '221';
DELETE FROM tamweenclientdetail WHERE clientid = '285';
DELETE FROM client WHERE clientid = '285';
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:41:47";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 11:11:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientController.php', '2023-02-25 11:11:47', '1', 'show', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:41:56";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 11:11:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:11:56', '1', 'addsellBill', '156.210.14.93', '', 'DESKTOP');
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) VALUES ('عمي مجدي كفر شكر مصر' , '', '', '', '0', '', '0', '2023-02-25 11:18:18', '4', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2023-02-25','0','0','','0','0','0');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('327', '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 ) VALUES ('327','0','0','0','إضافة عميل جديد','327', '0', '2023-02-25 11:18:18', '4', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1');
INSERT INTO accountstree (name, customName, parent, itemtype, itemfrom, notes, del, userid, mydate, itemtype2, theValue, theOrder, layingOrder,reportid) VALUES ('عمي مجدي كفر شكر مصر', 'عمي مجدي كفر شكر مصر', '23', '3', '0', '', '0', '4', '2023-02-25', '1', '0', '0', '','2');
UPDATE client SET clientname = 'عمي مجدي كفر شكر مصر', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2023-02-25', userid = '4'  , 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' WHERE clientid = '327';
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:49:45";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:19:45", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:19:45', '4', 'addAndRetuen', '197.61.10.130', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063f9caa39aa84
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(327,@clientdebt,@clientname);
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) VALUES ('2023-02-25 10:45:23', '063f9caa39aa84', '327', '0.00', '12250', '0', '1', '12250', '12250', '0', '12250', '7', '2023-02-25 11:19:45', '', '4', '0', 'عمي مجدي كفر شكر مصر', '7', '1', '3', '0', 'عمي مجدي كفر شكر مصر', '70' ,'0','','','','','-1','0','0','0','0','0','12250','0','','0','0','0','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '12250', userid = '4' WHERE clientid = '327';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('327','0.00','12250','0','اضافة فاتورة مبيعات','10361', '12250', '2023-02-25 11:19:45', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '12250', '0', null, '0', null, null,'', '0','1','1','12250','1');
UPDATE client SET  inUse = 0 where clientid = 327;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 1484;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('160','00384', '10361', '1', '384', '35', '175', '6125', '0', '', '0', '2023-02-25 11:19:45', '384', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','1484-10,');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30215;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (384, '2023-02-25', 6125, 5250, 6475
                    , 5862.5, 6475, 5862.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6125, sellCostBuyPrice =sellCostBuyPrice+5250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5862.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5862.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+35
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 6125, 5250, 6475
                    , 5862.5, 6475, 5862.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6125, sellCostBuyPrice =sellCostBuyPrice+5250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5862.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5862.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '0', userid = '4', storedetaildate = '2023-02-25 11:19:45' WHERE storedetailid = '1293';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('384', '7', '35', '1', '10361', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35.00', '0', '4', '2023-02-25 11:19: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) VALUES ('175','00382', '10361', '1', '382', '19', '175', '3325', '0', '', '0', '2023-02-25 11:19:45', '382', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 172.50, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 172.50
                where sellbilldetailid = 30216;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (382, '2023-02-25', 3325, 3325, 3610
                    , 3277.5, 3610, 3277.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 19, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3325, sellCostBuyPrice =sellCostBuyPrice+3325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3277.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3277.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+19
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 3325, 3325, 3610
                    , 3277.5, 3610, 3277.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3325, sellCostBuyPrice =sellCostBuyPrice+3325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3277.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3277.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '0', userid = '4', storedetaildate = '2023-02-25 11:19:45' WHERE storedetailid = '1291';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('382', '7', '19', '1', '10361', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19.00', '0', '4', '2023-02-25 11:19:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 where id = 1486;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('185','00385', '10361', '1', '385', '16', '175', '2800', '0', '', '0', '2023-02-25 11:19:45', '385', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','1486-16,');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30217;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (385, '2023-02-25', 2800, 2400, 2960
                    , 2680, 2960, 2680, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2800, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+16
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 2800, 2400, 2960
                    , 2680, 2960, 2680, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2800, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '6', userid = '4', storedetaildate = '2023-02-25 11:19:45' WHERE storedetailid = '1294';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('385', '7', '16', '1', '10361', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22.00', '6', '4', '2023-02-25 11:19:45','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 12250, 10975, 13045
                    , 11820, 13045, 11820, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12250, sellCostBuyPrice =sellCostBuyPrice+10975
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13045, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13045, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (327, '2023-02-25', 12250, 10975, 13045
                    , 11820, 13045, 11820, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12250, sellCostBuyPrice =sellCostBuyPrice+10975
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13045, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13045, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 12250, 10975, 13045
                    , 11820, 13045, 11820, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+12250, netSellCostBuyPrice = netSellCostBuyPrice+10975
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+13045
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+11820
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+13045
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+11820
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063f9caa39aa84 and sellbillId = 10361 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:49:46";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:19:46", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:19:46', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
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) VALUES ('ملاك كفر شكر مصر' , '', '', '', '0', '', '0', '2023-02-25 11:20:02', '4', '0','','0','','-10','0','10000',',-20,','-1','0','.','0','0','.','2023-02-25','0','0','','0','0','0');
INSERT INTO tamweenclientdetail (clientid, noOfPersonsTamween, noOfPersonsDa3m, cardNum, cardPassword) VALUES ('328', '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 ) VALUES ('328','0','0','0','إضافة عميل جديد','328', '0', '2023-02-25 11:20:02', '4', 'clientController.php', '', '0', '0', null, '0', null, null,'', '0','1','1','0','1');
INSERT INTO accountstree (name, customName, parent, itemtype, itemfrom, notes, del, userid, mydate, itemtype2, theValue, theOrder, layingOrder,reportid) VALUES ('ملاك كفر شكر مصر', 'ملاك كفر شكر مصر', '23', '3', '0', '', '0', '4', '2023-02-25', '1', '0', '0', '','2');
UPDATE client SET clientname = 'ملاك كفر شكر مصر', clientaddress = '', clientphone = '', clientmobile = '', clientdebt = '0.00', clientdetails = '', conditions = '0', clientdate = '2023-02-25', userid = '4'  , 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' WHERE clientid = '328';
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:50:50";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:20:50", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:20:50', '4', 'addAndRetuen', '197.61.10.130', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063f9d2b23f390
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(328,@clientdebt,@clientname);
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) VALUES ('2023-02-25 11:19:46', '063f9d2b23f390', '328', '0.00', '8750', '0', '1', '8750', '8750', '0', '8750', '7', '2023-02-25 11:20:50', '', '4', '0', 'ملاك كفر شكر مصر', '7', '1', '3', '0', 'ملاك كفر شكر مصر', '50' ,'0','','','','','-1','0','0','0','0','0','8750','0','','0','0','0','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '8750', userid = '4' WHERE clientid = '328';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('328','0.00','8750','0','اضافة فاتورة مبيعات','10362', '8750', '2023-02-25 11:20:50', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8750', '0', null, '0', null, null,'', '0','1','1','8750','1');
UPDATE client SET  inUse = 0 where clientid = 328;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 1490;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 2608;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('175','00387', '10362', '1', '387', '29', '175', '5075', '0', '', '0', '2023-02-25 11:20:50', '387', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','1490-15,2608-1,');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 168.75, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 168.75
                where sellbilldetailid = 30218;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (387, '2023-02-25', 5075, 5075, 5075
                    , 4893.75, 5075, 4893.75, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 29, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5075, sellCostBuyPrice =sellCostBuyPrice+5075
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5075, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4893.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4893.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+29
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 5075, 5075, 5075
                    , 4893.75, 5075, 4893.75, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5075, sellCostBuyPrice =sellCostBuyPrice+5075
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5075, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4893.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4893.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '0', userid = '4', storedetaildate = '2023-02-25 11:20:50' WHERE storedetailid = '1296';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '7', '29', '1', '10362', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29.00', '0', '4', '2023-02-25 11:20:50','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+11 where id = 1488;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('185','00386', '10362', '1', '386', '11', '175', '1925', '0', '', '0', '2023-02-25 11:20:50', '386', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','1488-11,');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 962.27, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 962.27
                where sellbilldetailid = 30219;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (386, '2023-02-25', 1925, 1925, 2035
                    , 10584.97, 2035, 10584.97, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1925, sellCostBuyPrice =sellCostBuyPrice+1925
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10584.97
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10584.97
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+11
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 1925, 1925, 2035
                    , 10584.97, 2035, 10584.97, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1925, sellCostBuyPrice =sellCostBuyPrice+1925
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10584.97
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10584.97
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '2', userid = '4', storedetaildate = '2023-02-25 11:20:50' WHERE storedetailid = '1295';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('386', '7', '11', '1', '10362', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13.00', '2', '4', '2023-02-25 11:20:50','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 1482;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 2618;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('181.5','00383', '10362', '1', '383', '10', '175', '1750', '0', '', '0', '2023-02-25 11:20:50', '383', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','1482-6,2618-3,');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30220;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (383, '2023-02-25', 1750, 1500, 1850
                    , 1675, 1850, 1675, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1750, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1675
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1675
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 1750, 1500, 1850
                    , 1675, 1850, 1675, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1750, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1675
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1675
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '3', userid = '4', storedetaildate = '2023-02-25 11:20:50' WHERE storedetailid = '1292';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('383', '7', '10', '1', '10362', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13.00', '3', '4', '2023-02-25 11:20:50','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 8750, 8500, 8960
                    , 17153.72, 8960, 17153.72, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8750, sellCostBuyPrice =sellCostBuyPrice+8500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17153.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17153.72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (328, '2023-02-25', 8750, 8500, 8960
                    , 17153.72, 8960, 17153.72, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8750, sellCostBuyPrice =sellCostBuyPrice+8500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17153.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17153.72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 8750, 8500, 8960
                    , 17153.72, 8960, 17153.72, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8750, netSellCostBuyPrice = netSellCostBuyPrice+8500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8960
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+17153.72
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8960
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+17153.72
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063f9d2b23f390 and sellbillId = 10362 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:50:50";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:20:50", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:20:51', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:51:35";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:21:35", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 11:21:35', '4', '', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 07:51:37";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:21:37", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:21:37', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:02:33";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:32:33", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 11:32:33', '4', '', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:02:35";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:32:35", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:32:35', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:06:38";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:36:39", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2023-02-25 11:36:39', '4', '', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:06:49";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:36:49", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2023-02-25 11:36:49', '4', 'show', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:07:02";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:37:03", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:37:03', '4', 'showDetail', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:07:25";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:37:25", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:37:25', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:08:13";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 11:38:13", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 11:38:13', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:36:07";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 12:06:07", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:06:07', '4', 'addAndRetuen', '197.61.10.130', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063f9d7056d81f
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 11:38:13', '063f9d7056d81f', '1', '0.00', '0', '0', '1', '150', '150', '150', '0', '7', '2023-02-25 12:06:07', '', '4', '0', 'نقدي', '7', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','150','0','','0','0','150','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '4' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10363', '0', '2023-02-25 12:06:07', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '150', '0', null, '0', null, null,'', '0','1','1','0','1');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('150','00515', '10363', '1', '515', '1', '150', '150', '0', '', '0', '2023-02-25 12:06:07', '515', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 185.00
                where sellbilldetailid = 30221;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (515, '2023-02-25', 150, 150, 220
                    , 185, 220, 185, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 150, 150, 220
                    , 185, 220, 185, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '1', userid = '4', storedetaildate = '2023-02-25 12:06:07' WHERE storedetailid = '1299';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('515', '7', '1', '1', '10363', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2.00', '1', '4', '2023-02-25 12:06:07','0','0');
UPDATE save SET  savecurrentvalue = '1350',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('1200.00','150', '0', '7', 'اضافة فاتورة مبيعات', '10363', '1350', '2023-02-25 12:06:07', '4',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 150, 150, 220
                    , 185, 220, 185, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 150, 150, 220
                    , 185, 220, 185, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+150, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 150, 150, 220
                    , 185, 220, 185, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+150, netSellCostBuyPrice = netSellCostBuyPrice+150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+185
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+185
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063f9d7056d81f and sellbillId = 10363 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:36:07";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 12:06:08", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:06:08', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:36:11";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 12:06:11", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 12:06:11', '4', '', '197.61.10.130', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:36:19";
UPDATE user SET loginip = "197.61.10.130", lastactivetime = "2023-02-25 12:06:19", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:06:20', '4', 'addsellBill', '197.61.10.130', '', 'DESKTOP');
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 < "2023-02-25 08:50:38";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:20:38", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 12:20:38', '4', '', '197.61.88.158', '', 'DESKTOP');
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 < "2023-02-25 08:50:38";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:50:41";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:20:41", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:20:41', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:51:45";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:21:45", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:21:46', '4', 'addAndRetuen', '197.61.88.158', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063f9e0f98445f
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 12:20:41', '063f9e0f98445f', '1', '0.00', '0', '310', '1', '1570', '1260', '1260', '0', '7', '2023-02-25 12:21:46', '', '4', '0', 'نقدي', '7', '0', '3', '0', 'نقدي', '7' ,'0','','','','','-1','0','0','0','0','0','1260','0','','0','0','1260','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '4' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10364', '0', '2023-02-25 12:21:46', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1260', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 11139;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('210','00518', '10364', '1', '518', '3', '150', '450', '0', '', '0', '2023-02-25 12:21:46', '518', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','11139-3,');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 180.00
                where sellbilldetailid = 30222;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (518, '2023-02-25', 361.146496815, 450, 630
                    , 540, 630, 540, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+361.146496815, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+630, sellCostMeanBuyPrice = sellCostMeanBuyPrice+540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+630, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (7, '2023-02-25', 361.146496815, 450, 630
                    , 540, 630, 540, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+361.146496815, sellCostBuyPrice =sellCostBuyPrice+450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+630, sellCostMeanBuyPrice = sellCostMeanBuyPrice+540
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+630, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+540
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '37', userid = '4', storedetaildate = '2023-02-25 12:21:46' WHERE storedetailid = '1302';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('518', '7', '3', '1', '10364', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40.00', '37', '4', '2023-02-25 12:21:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 10449;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('270','01172', '10364', '1', '1172', '4', '280', '1120', '0', '', '0', '2023-02-25 12:21:46', '1172', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','10449-4,');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
                where sellbilldetailid = 30223;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1172, '2023-02-25', 898.853503185, 1080, 1080
                    , 1080, 1080, 1080, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+898.853503185, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (7, '2023-02-25', 898.853503185, 1080, 1080
                    , 1080, 1080, 1080, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+898.853503185, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '23', userid = '4', storedetaildate = '2023-02-25 12:21:46' WHERE storedetailid = '4302';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1172', '7', '4', '1', '10364', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27.00', '23', '4', '2023-02-25 12:21:46','0','0');
UPDATE save SET  savecurrentvalue = '2610',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('1350.00','1260', '0', '7', 'اضافة فاتورة مبيعات', '10364', '2610', '2023-02-25 12:21:46', '4',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 1260, 1530, 1710
                    , 1620, 1710, 1620, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1710, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1710, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 1260, 1530, 1710
                    , 1620, 1710, 1620, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1530
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1710, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1710, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 1260, 1530, 1710
                    , 1620, 1710, 1620, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1260, netSellCostBuyPrice = netSellCostBuyPrice+1530
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1710
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1620
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1710
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1620
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063f9e0f98445f and sellbillId = 10364 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:51:46";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:21:46", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:21:46', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:51:48";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:21:48", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 12:21:48', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:51:52";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:21:52", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:21:52', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:52:22";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:22:22", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:22:22', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:52:41";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:22:41", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:22:41', '4', 'add', '197.61.88.158', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('-1', 'شحن الكهرباء', '', '500', '2023-02-25', '4', '0','-1','7','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '2110',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2610.00','500', '1', '7', 'إضافة مصروف', '2681', '2110', '2023-02-25 12:22:41', '4',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '500', '500', '2023-02-25', '4', '0', '0', '2023-02-25 12:22:41','اضافة اسم مصروف( شحن الكهرباء )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6310', '160', '500', '','0');
UPDATE accountstree SET name = '', customName = '', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-12-01', itemtype2 = '1', theValue = '-1135990', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '160';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6310', '141', '500', '','0');
UPDATE accountstree SET name = 'خزينة محل العميد', customName = 'خزينة محل العميد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1093962', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '141';
UPDATE expenses SET expensestypeid = '-1', expensesname = 'شحن الكهرباء', expensesdetails = '', expensesValue = '500.00', expensesdate = '2023-02-25', userid = '4', conditions = '0',saveid = '7' , dailyentryid = '6310', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2681';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:52:41";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:22:41", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:22:41', '4', 'sucess', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:52:42";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:22:42", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:22:42', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:52:52";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:22:52", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:22:52', '4', 'add', '197.61.88.158', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('-1', 'قبض روني بالنسبه', '', '900', '2023-02-25', '4', '0','-1','7','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '1210',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2110.00','900', '1', '7', 'إضافة مصروف', '2682', '1210', '2023-02-25 12:22:52', '4',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '900', '900', '2023-02-25', '4', '0', '0', '2023-02-25 12:22:52','اضافة اسم مصروف( قبض روني بالنسبه )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6311', '160', '900', '','0');
UPDATE accountstree SET name = '', customName = '', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-12-01', itemtype2 = '1', theValue = '-1136890', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '160';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6311', '141', '900', '','0');
UPDATE accountstree SET name = 'خزينة محل العميد', customName = 'خزينة محل العميد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1094862', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '141';
UPDATE expenses SET expensestypeid = '-1', expensesname = 'قبض روني بالنسبه', expensesdetails = '', expensesValue = '900.00', expensesdate = '2023-02-25', userid = '4', conditions = '0',saveid = '7' , dailyentryid = '6311', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2682';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:52:52";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:22:52", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:22:52', '4', 'sucess', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:52:54";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:22:54", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:22:54', '4', 'show', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:52:54";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:22:54", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 12:22:54', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:52:57";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:22:57", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:22:57', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:53:14";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:23:14", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:23:14', '4', 'add', '197.61.88.158', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('-1', 'قبض العميد بالنسبه', '', '950', '2023-02-25', '4', '0','-1','7','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '260',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('1210.00','950', '1', '7', 'إضافة مصروف', '2683', '260', '2023-02-25 12:23:14', '4',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '950', '950', '2023-02-25', '4', '0', '0', '2023-02-25 12:23:14','اضافة اسم مصروف( قبض العميد بالنسبه )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6312', '160', '950', '','0');
UPDATE accountstree SET name = '', customName = '', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-12-01', itemtype2 = '1', theValue = '-1137840', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '160';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6312', '141', '950', '','0');
UPDATE accountstree SET name = 'خزينة محل العميد', customName = 'خزينة محل العميد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1095812', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '141';
UPDATE expenses SET expensestypeid = '-1', expensesname = 'قبض العميد بالنسبه', expensesdetails = '', expensesValue = '950.00', expensesdate = '2023-02-25', userid = '4', conditions = '0',saveid = '7' , dailyentryid = '6312', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2683';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:53:14";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:23:14", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:23:14', '4', 'sucess', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:53:16";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:23:16", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:23:16', '4', 'show', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:53:26";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:23:26", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 12:23:26', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:53:50";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:23:50", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:23:50', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:54:01";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:24:01", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:24:01', '4', 'add', '197.61.88.158', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('-1', 'تروسيكل', '', '30', '2023-02-25', '4', '0','-1','7','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '230',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('260.00','30', '1', '7', 'إضافة مصروف', '2684', '230', '2023-02-25 12:24:01', '4',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '30', '30', '2023-02-25', '4', '0', '0', '2023-02-25 12:24:01','اضافة اسم مصروف( تروسيكل )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6313', '160', '30', '','0');
UPDATE accountstree SET name = '', customName = '', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-12-01', itemtype2 = '1', theValue = '-1137870', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '160';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6313', '141', '30', '','0');
UPDATE accountstree SET name = 'خزينة محل العميد', customName = 'خزينة محل العميد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1095842', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '141';
UPDATE expenses SET expensestypeid = '-1', expensesname = 'تروسيكل', expensesdetails = '', expensesValue = '30.00', expensesdate = '2023-02-25', userid = '4', conditions = '0',saveid = '7' , dailyentryid = '6313', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2684';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:54:01";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:24:01", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:24:01', '4', 'sucess', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:54:03";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:24:03", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 12:24:03', '4', 'show', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:54:11";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:24:11", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:24:11', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:55:09";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:25:09", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 12:25:09', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:56:01";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:26:01", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:26:01', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 08:56:29";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:26:29", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:26:29', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:05:11";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:35:11", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 12:35:11', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:05:20";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:35:20", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:35:20', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:08:12";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:38:12", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:38:12', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:09:19";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:39:19", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:39:19', '4', 'addAndRetuen', '197.61.88.158', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063f9e51440e54
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 12:38:12', '063f9e51440e54', '1', '0.00', '0', '60', '1', '360', '300', '300', '0', '7', '2023-02-25 12:39:19', '', '4', '0', 'نقدي', '7', '0', '3', '0', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','300','0','','0','0','300','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '4' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10365', '0', '2023-02-25 12:39:19', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '300', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 2288;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('195','00536', '10365', '1', '536', '2', '180', '360', '0', '', '0', '2023-02-25 12:39:19', '536', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','2288-2,');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 185.00
                where sellbilldetailid = 30224;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (536, '2023-02-25', 300, 360, 390
                    , 370, 390, 370, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (7, '2023-02-25', 300, 360, 390
                    , 370, 390, 370, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '54', userid = '4', storedetaildate = '2023-02-25 12:39:19' WHERE storedetailid = '1679';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('536', '7', '2', '1', '10365', 'اضافة فاتورة مبيعات', 'sellbillController.php', '56.00', '54', '4', '2023-02-25 12:39:19','0','0');
UPDATE save SET  savecurrentvalue = '530',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('230.00','300', '0', '7', 'اضافة فاتورة مبيعات', '10365', '530', '2023-02-25 12:39:19', '4',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 300, 360, 390
                    , 370, 390, 370, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 300, 360, 390
                    , 370, 390, 370, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+390, sellCostMeanBuyPrice = sellCostMeanBuyPrice+370
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+390, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+370
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 300, 360, 390
                    , 370, 390, 370, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+300, netSellCostBuyPrice = netSellCostBuyPrice+360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+390
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+370
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+390
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+370
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063f9e51440e54 and sellbillId = 10365 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:09:20";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:39:20", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:39:20', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:09:23";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:39:23", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 12:39:23', '4', '', '197.61.88.158', '', 'DESKTOP');
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 < "2023-02-25 09:15:09";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:45:09", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 12:45:09', '4', '', '197.61.88.158', '', 'DESKTOP');
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 < "2023-02-25 09:15:09";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:15:11";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:45:11", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:45:11', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:19:35";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 12:49:36", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 12:49:36', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
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 < "2023-02-25 09:32:02";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:02:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 13:02:02', '1', '', '156.210.14.93', '', 'DESKTOP');
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 < "2023-02-25 09:32:03";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:32:20";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:02:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 13:02:20', '1', '', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:47:07";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:17:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 13:17:07', '1', 'add', '156.210.14.93', '', 'DESKTOP');
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 deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,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,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment ,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            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;
;;

;
BEGIN;
CALL insertUniqueOptNum(1267,8,1,635,13,'2023-02-25',1,0, '' ,0,0,0,0,0,'2023-02-25 13:17:07',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2040';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 635, 0, 0
                    , 210.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 635, 0, 0
                    , 210.00, -4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-02-22*210.00,4*2023-02-25*210.00," WHERE transferproductid = 5474;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('635', '8', '13', '1', '5474', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '175', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1912';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 635, 0, 0
                    , 210.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 635, 0, 0
                    , 210.00, 4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('635', '1', '13', '0', '5474', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '162.00', '175', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '181', '18', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3286';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 8, 181, 0, 0
                    , 195.00, 16, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-16, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 181, 0, 0
                    , 195.00, -2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2022-04-18*195.00,2*2023-02-25*195.00," WHERE transferproductid = 5475;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('181', '8', '18', '1', '5475', 'تحويل منتجات من المخزن', 'storemovementController.php', '18.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '68', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '181';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 181, 0, 0
                    , 195.00, 16, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 181, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('181', '1', '18', '0', '5475', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '50.00', '68', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '800', '9', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2437';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-10', 8, 800, 0, 0
                    , 180.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-03-10*180.00," WHERE transferproductid = 5476;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('800', '8', '9', '1', '5476', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '58', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2406';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-10', 1, 800, 0, 0
                    , 180.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('800', '1', '9', '0', '5476', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '49.00', '58', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '634', '16', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2041';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 634, 0, 0
                    , 210.00, 11, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-11, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 634, 0, 0
                    , 210.00, -5, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "11*2022-02-22*210.00,5*2023-02-25*210.00," WHERE transferproductid = 5477;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('634', '8', '16', '1', '5477', 'تحويل منتجات من المخزن', 'storemovementController.php', '23.00', '7', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '239', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1911';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 634, 0, 0
                    , 210.00, 11, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 634, 0, 0
                    , 210.00, 5, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('634', '1', '16', '0', '5477', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '223.00', '239', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '571', '19', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2045';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 571, 0, 0
                    , 210.00, 18, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-18, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 571, 0, 0
                    , 210.00, -1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2022-02-22*210.00,1*2023-02-25*210.00," WHERE transferproductid = 5478;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('571', '8', '19', '1', '5478', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '219', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1530';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 571, 0, 0
                    , 210.00, 18, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 571, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('571', '1', '19', '0', '5478', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '200.00', '219', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '570', '9', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2047';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 570, 0, 0
                    , 210.00, 8, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 570, 0, 0
                    , 210.00, -1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2022-02-22*210.00,1*2023-02-25*210.00," WHERE transferproductid = 5479;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('570', '8', '9', '1', '5479', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '7', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '130', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1529';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 570, 0, 0
                    , 210.00, 8, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 570, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('570', '1', '9', '0', '5479', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '121.00', '130', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '569', '36', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2053';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 569, 0, 0
                    , 210.00, 36, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-36, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "36*2022-02-22*210.00," WHERE transferproductid = 5480;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('569', '8', '36', '1', '5480', 'تحويل منتجات من المخزن', 'storemovementController.php', '36.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '295', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1528';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 569, 0, 0
                    , 210.00, 36, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('569', '1', '36', '0', '5480', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '259.00', '295', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '80', '26', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1132';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 8, 80, 0, 0
                    , 200.00, 22, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-22, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 8, 80, 0, 0
                    , 200.00, 4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-4, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "22*2021-12-12*200.00,4*2022-04-18*200.00," WHERE transferproductid = 5481;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '8', '26', '1', '5481', 'تحويل منتجات من المخزن', 'storemovementController.php', '24.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '26', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '80';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 1, 80, 0, 0
                    , 200.00, 22, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+22, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 80, 0, 0
                    , 200.00, 4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '1', '26', '0', '5481', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '26', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '85', '16', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1137';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 8, 85, 0, 0
                    , 205.00, 16, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-16, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2021-12-12*205.00," WHERE transferproductid = 5482;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('85', '8', '16', '1', '5482', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '85';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 1, 85, 0, 0
                    , 205.00, 16, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('85', '1', '16', '0', '5482', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '16', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '537', '16', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1675';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 8, 537, 0, 0
                    , 195.00, 16, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-16, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2021-12-12*195.00," WHERE transferproductid = 5483;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('537', '8', '16', '1', '5483', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '537';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 1, 537, 0, 0
                    , 195.00, 16, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('537', '1', '16', '0', '5483', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '16', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '536', '14', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3228';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 8, 536, 0, 0
                    , 195.00, 12, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 536, 0, 0
                    , 195.00, -2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2022-04-15*195.00,2*2023-02-25*195.00," WHERE transferproductid = 5484;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('536', '8', '14', '1', '5484', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '536';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 536, 0, 0
                    , 195.00, 12, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 536, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('536', '1', '14', '0', '5484', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '1.00', '15', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1114', '14', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4063';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 8, 1114, 0, 0
                    , 210.00, 13, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 1114, 0, 0
                    , 210.00, -1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2022-07-21*210.00,1*2023-02-25*210.00," WHERE transferproductid = 5485;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1114', '8', '14', '1', '5485', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '54', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3970';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 1114, 0, 0
                    , 210.00, 13, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1114, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1114', '1', '14', '0', '5485', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '40.00', '54', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '146', '15', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3997';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 8, 146, 0, 0
                    , 180.00, 13, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 146, 0, 0
                    , 180.00, -2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2022-07-19*180.00,2*2023-02-25*180.00," WHERE transferproductid = 5486;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('146', '8', '15', '1', '5486', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '189', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '146';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 1, 146, 0, 0
                    , 180.00, 13, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 146, 0, 0
                    , 180.00, 2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('146', '1', '15', '0', '5486', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '174.00', '189', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1124', '29', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4104';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-18', 8, 1124, 0, 0
                    , 210.00, 29, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-29, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "29*2022-08-18*210.00," WHERE transferproductid = 5487;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1124', '8', '29', '1', '5487', 'تحويل منتجات من المخزن', 'storemovementController.php', '32.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '152', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4095';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-18', 1, 1124, 0, 0
                    , 210.00, 29, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+29, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1124', '1', '29', '0', '5487', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '123.00', '152', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '18', '14', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1085';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 8, 18, 0, 0
                    , 185.00, 14, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-14, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "14*2021-11-08*185.00," WHERE transferproductid = 5488;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('18', '8', '14', '1', '5488', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '194', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '18';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 18, 0, 0
                    , 185.00, 14, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('18', '1', '14', '0', '5488', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '180.00', '194', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '10', '9', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1070';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-07', 8, 10, 0, 0
                    , 155.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-07-07*155.00," WHERE transferproductid = 5489;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10', '8', '9', '1', '5489', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '49', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '10';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-07', 1, 10, 0, 0
                    , 155.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('10', '1', '9', '0', '5489', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '40.00', '49', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '14', '9', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1082';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 8, 14, 0, 0
                    , 150.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-04-18*150.00," WHERE transferproductid = 5490;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14', '8', '9', '1', '5490', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '14';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 14, 0, 0
                    , 150.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14', '1', '9', '0', '5490', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '1.00', '10', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '15', '11', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1083';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 8, 15, 0, 0
                    , 175.00, 3, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 8, 15, 0, 0
                    , 175.00, 8, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2021-11-08*175.00,8*2022-07-19*175.00," WHERE transferproductid = 5491;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15', '8', '11', '1', '5491', 'تحويل منتجات من المخزن', 'storemovementController.php', '12.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '11', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '15';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 15, 0, 0
                    , 175.00, 3, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 1, 15, 0, 0
                    , 175.00, 8, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('15', '1', '11', '0', '5491', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '11', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '6', '14', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1142';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 8, 6, 0, 0
                    , 145.00, 14, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-14, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "14*2021-11-08*145.00," WHERE transferproductid = 5492;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '8', '14', '1', '5492', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '72', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '6';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 6, 0, 0
                    , 145.00, 14, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('6', '1', '14', '0', '5492', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '58.00', '72', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '674', '22', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2025';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 674, 0, 0
                    , 145.00, 21, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-21, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 674, 0, 0
                    , 145.00, -1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "21*2022-02-22*145.00,1*2023-02-25*145.00," WHERE transferproductid = 5493;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('674', '8', '22', '1', '5493', 'تحويل منتجات من المخزن', 'storemovementController.php', '22.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '92', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1958';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 674, 0, 0
                    , 145.00, 21, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 674, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('674', '1', '22', '0', '5493', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '70.00', '92', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '24', '22', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1097';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 8, 24, 0, 0
                    , 170.00, 12, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 24, 0, 0
                    , 170.00, 10, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2021-11-08*170.00,10*2022-02-22*170.00," WHERE transferproductid = 5494;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('24', '8', '22', '1', '5494', 'تحويل منتجات من المخزن', 'storemovementController.php', '22.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '22', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '24';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 24, 0, 0
                    , 170.00, 12, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 24, 0, 0
                    , 170.00, 10, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('24', '1', '22', '0', '5494', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '22', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '806', '20', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3092';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 8, 806, 0, 0
                    , 145.00, 20, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "20*2022-04-11*145.00," WHERE transferproductid = 5495;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('806', '8', '20', '1', '5495', 'تحويل منتجات من المخزن', 'storemovementController.php', '21.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '201', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2425';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 806, 0, 0
                    , 145.00, 20, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('806', '1', '20', '0', '5495', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '181.00', '201', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '641', '16', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2031';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 641, 0, 0
                    , 140.00, 12, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 641, 0, 0
                    , 140.00, -4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2022-02-22*140.00,4*2023-02-25*140.00," WHERE transferproductid = 5496;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('641', '8', '16', '1', '5496', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '49', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1920';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 641, 0, 0
                    , 140.00, 12, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 641, 0, 0
                    , 140.00, 4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('641', '1', '16', '0', '5496', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '33.00', '49', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '639', '33', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-12', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2030';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 639, 0, 0
                    , 125.00, 33, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-33, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "33*2022-02-22*125.00," WHERE transferproductid = 5497;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('639', '8', '33', '1', '5497', 'تحويل منتجات من المخزن', 'storemovementController.php', '21.00', '-12', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '68', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1918';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 639, 0, 0
                    , 125.00, 33, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+33, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('639', '1', '33', '0', '5497', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '35.00', '68', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1060', '34', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3717';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-04', 8, 1060, 0, 0
                    , 265.00, 32, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-32, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 1060, 0, 0
                    , 265.00, -2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 265.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "32*2022-06-04*265.00,2*2023-02-25*265.00," WHERE transferproductid = 5498;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1060', '8', '34', '1', '5498', 'تحويل منتجات من المخزن', 'storemovementController.php', '34.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3712';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-04', 1, 1060, 0, 0
                    , 265.00, 32, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1060, 0, 0
                    , 265.00, 2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1060', '1', '34', '0', '5498', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '1.00', '35', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '950', '23', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3084';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 8, 950, 0, 0
                    , 165.00, 23, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-23, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "23*2022-04-11*165.00," WHERE transferproductid = 5499;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('950', '8', '23', '1', '5499', 'تحويل منتجات من المخزن', 'storemovementController.php', '26.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '23', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3082';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 950, 0, 0
                    , 165.00, 23, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+23, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('950', '1', '23', '0', '5499', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '23', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '412', '11', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2026';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 412, 0, 0
                    , 140.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 412, 0, 0
                    , 140.00, -2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-02-22*140.00,2*2023-02-25*140.00," WHERE transferproductid = 5500;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '8', '11', '1', '5500', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '11', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '412';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 412, 0, 0
                    , 140.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 412, 0, 0
                    , 140.00, 2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '1', '11', '0', '5500', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '11', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '429', '9', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2039';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 429, 0, 0
                    , 170.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-02-22*170.00," WHERE transferproductid = 5501;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('429', '8', '9', '1', '5501', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '429';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 429, 0, 0
                    , 170.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('429', '1', '9', '0', '5501', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '1.00', '10', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '781', '19', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3089';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 8, 781, 0, 0
                    , 130.00, 17, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-17, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 781, 0, 0
                    , 130.00, -2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 130.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "17*2022-04-11*130.00,2*2023-02-25*130.00," WHERE transferproductid = 5502;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('781', '8', '19', '1', '5502', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '484', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2362';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 781, 0, 0
                    , 130.00, 17, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+17, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 781, 0, 0
                    , 130.00, 2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('781', '1', '19', '0', '5502', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '465.00', '484', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '413', '10', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3287';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 8, 413, 0, 0
                    , 140.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 413, 0, 0
                    , 140.00, -1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-04-18*140.00,1*2023-02-25*140.00," WHERE transferproductid = 5503;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('413', '8', '10', '1', '5503', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '151', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '413';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 413, 0, 0
                    , 140.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 413, 0, 0
                    , 140.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('413', '1', '10', '0', '5503', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '141.00', '151', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '418', '15', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3088';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 8, 418, 0, 0
                    , 140.00, 15, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "15*2022-04-11*140.00," WHERE transferproductid = 5504;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('418', '8', '15', '1', '5504', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '418';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 418, 0, 0
                    , 140.00, 15, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('418', '1', '15', '0', '5504', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-16.00', '-1', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '432', '24', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3779';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-10', 8, 432, 0, 0
                    , 125.00, 24, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2022-06-10*125.00," WHERE transferproductid = 5505;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('432', '8', '24', '1', '5505', 'تحويل منتجات من المخزن', 'storemovementController.php', '24.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '97', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '432';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-10', 1, 432, 0, 0
                    , 125.00, 24, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('432', '1', '24', '0', '5505', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '73.00', '97', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '283', '19', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4000';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 8, 283, 0, 0
                    , 150.00, 18, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-18, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 283, 0, 0
                    , 150.00, -1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 150.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2022-07-19*150.00,1*2023-02-25*150.00," WHERE transferproductid = 5506;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('283', '8', '19', '1', '5506', 'تحويل منتجات من المخزن', 'storemovementController.php', '18.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '37', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '283';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 1, 283, 0, 0
                    , 150.00, 18, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 283, 0, 0
                    , 150.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('283', '1', '19', '0', '5506', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '18.00', '37', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1012', '6', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3465';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-05-16', 8, 1012, 0, 0
                    , 210.00, 3, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-15', 8, 1012, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-22', 8, 1012, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 1012, 0, 0
                    , 210.00, -1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2022-05-16*210.00,1*2022-06-15*210.00,1*2022-08-22*210.00,1*2023-02-25*210.00," WHERE transferproductid = 5507;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1012', '8', '6', '1', '5507', 'تحويل منتجات من المخزن', 'storemovementController.php', '6.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3462';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-05-16', 1, 1012, 0, 0
                    , 210.00, 3, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-15', 1, 1012, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-22', 1, 1012, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1012, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1012', '1', '6', '0', '5507', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '1.00', '7', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1019', '8', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3518';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-05-12', 8, 1019, 0, 0
                    , 210.00, 7, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-7, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 1019, 0, 0
                    , 210.00, -1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2022-05-12*210.00,1*2023-02-25*210.00," WHERE transferproductid = 5508;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1019', '8', '8', '1', '5508', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3502';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-05-12', 1, 1019, 0, 0
                    , 210.00, 7, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1019, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1019', '1', '8', '0', '5508', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '11.00', '19', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '662', '13', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2033';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 8, 662, 0, 0
                    , 185.00, 12, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 662, 0, 0
                    , 185.00, -1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 185.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2022-02-22*185.00,1*2023-02-25*185.00," WHERE transferproductid = 5509;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('662', '8', '13', '1', '5509', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1943';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 662, 0, 0
                    , 185.00, 12, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 662, 0, 0
                    , 185.00, 1, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('662', '1', '13', '0', '5509', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '11.00', '24', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '807', '14', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2439';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-26', 8, 807, 0, 0
                    , 180.00, 8, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 807, 0, 0
                    , 180.00, -6, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2022-04-26*180.00,6*2023-02-25*180.00," WHERE transferproductid = 5510;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('807', '8', '14', '1', '5510', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2426';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-26', 1, 807, 0, 0
                    , 180.00, 8, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 807, 0, 0
                    , 180.00, 6, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('807', '1', '14', '0', '5510', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '4.00', '18', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1041', '20', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3645';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-05-29', 8, 1041, 0, 0
                    , 210.00, 18, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-18, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 1041, 0, 0
                    , 210.00, -2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2022-05-29*210.00,2*2023-02-25*210.00," WHERE transferproductid = 5511;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1041', '8', '20', '1', '5511', 'تحويل منتجات من المخزن', 'storemovementController.php', '20.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '160', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3623';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-05-29', 1, 1041, 0, 0
                    , 210.00, 18, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1041, 0, 0
                    , 210.00, 2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1041', '1', '20', '0', '5511', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '140.00', '160', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '645', '9', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2034';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 645, 0, 0
                    , 205.00, -9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 205.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2023-02-25*205.00," WHERE transferproductid = 5512;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('645', '8', '9', '1', '5512', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '14', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1925';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 645, 0, 0
                    , 205.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('645', '1', '9', '0', '5512', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '5.00', '14', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '967', '11', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3226';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 8, 967, 0, 0
                    , 205.00, 7, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-7, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 967, 0, 0
                    , 205.00, -4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 205.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2022-04-15*205.00,4*2023-02-25*205.00," WHERE transferproductid = 5513;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('967', '8', '11', '1', '5513', 'تحويل منتجات من المخزن', 'storemovementController.php', '11.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '11', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3195';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 967, 0, 0
                    , 205.00, 7, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 967, 0, 0
                    , 205.00, 4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('967', '1', '11', '0', '5513', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '11', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1122', '7', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4105';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-18', 8, 1122, 0, 0
                    , 210.00, 4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-4, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 1122, 0, 0
                    , 210.00, -3, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2022-08-18*210.00,3*2023-02-25*210.00," WHERE transferproductid = 5514;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1122', '8', '7', '1', '5514', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4093';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-18', 1, 1122, 0, 0
                    , 210.00, 4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1122, 0, 0
                    , 210.00, 3, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1122', '1', '7', '0', '5514', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '7', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '647', '12', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2038';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-06', 8, 647, 0, 0
                    , 280.00, 3, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 647, 0, 0
                    , 280.00, -9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 280.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2022-07-06*280.00,9*2023-02-25*280.00," WHERE transferproductid = 5515;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('647', '8', '12', '1', '5515', 'تحويل منتجات من المخزن', 'storemovementController.php', '12.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '108', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1927';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-06', 1, 647, 0, 0
                    , 280.00, 3, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 647, 0, 0
                    , 280.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('647', '1', '12', '0', '5515', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '96.00', '108', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1113', '14', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4065';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 8, 1113, 0, 0
                    , 230.00, 12, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 1113, 0, 0
                    , 230.00, -2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 230.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2022-07-21*230.00,2*2023-02-25*230.00," WHERE transferproductid = 5516;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1113', '8', '14', '1', '5516', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3969';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 1113, 0, 0
                    , 230.00, 12, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1113, 0, 0
                    , 230.00, 2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1113', '1', '14', '0', '5516', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '4.00', '18', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '958', '9', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3169';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-14', 8, 958, 0, 0
                    , 205.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-06-14*205.00," WHERE transferproductid = 5517;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('958', '8', '9', '1', '5517', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '-7', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3155';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-14', 1, 958, 0, 0
                    , 205.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('958', '1', '9', '0', '5517', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '9', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1112', '21', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4064';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 8, 1112, 0, 0
                    , 255.00, 19, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-19, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 1112, 0, 0
                    , 255.00, -2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 255.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "19*2022-07-21*255.00,2*2023-02-25*255.00," WHERE transferproductid = 5518;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1112', '8', '21', '1', '5518', 'تحويل منتجات من المخزن', 'storemovementController.php', '21.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '87', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3968';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 1112, 0, 0
                    , 255.00, 19, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+19, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1112, 0, 0
                    , 255.00, 2, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1112', '1', '21', '0', '5518', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '66.00', '87', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1128', '9', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4129';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 1128, 0, 0
                    , 200.00, -9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 200.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2023-02-25*200.00," WHERE transferproductid = 5519;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1128', '8', '9', '1', '5519', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '-6', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '98', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4111';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1128, 0, 0
                    , 200.00, 9, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1128', '1', '9', '0', '5519', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '89.00', '98', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '996', '4', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3432';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 996, 0, 0
                    , 210.00, -4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2023-02-25*210.00," WHERE transferproductid = 5520;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('996', '8', '4', '1', '5520', 'تحويل منتجات من المخزن', 'storemovementController.php', '4.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3391';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 996, 0, 0
                    , 210.00, 4, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('996', '1', '4', '0', '5520', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '1.00', '5', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('8', '1', '1060', '24', '2023-02-25', '1', '0','1267',null,null,'2023-02-25 13:17:07',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-24', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3717';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 8, 1060, 0, 0
                    , 265.00, -24, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyprice = 265.00,
                        buyQuantity =buyQuantity+-24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2023-02-25*265.00," WHERE transferproductid = 5521;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1060', '8', '24', '1', '5521', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-24', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '59', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3712';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1060, 0, 0
                    , 265.00, 24, 0, 0, 1, '2023-02-25 13:17:07')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:17:07' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1060', '1', '24', '0', '5521', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '35.00', '59', '1', '2023-02-25','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:47:08";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:17:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 13:17:08', '1', 'editshow', '156.210.14.93', '', 'DESKTOP');
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 < "2023-02-25 09:55:15";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 13:25:15", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 13:25:15', '7', '', '197.192.238.254', '', 'DESKTOP');
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 < "2023-02-25 09:55:15";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:55:45";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 13:25:45", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:25:45', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
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 < "2023-02-25 09:57:30";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:27:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 13:27:30', '1', '', '156.210.14.93', '', 'DESKTOP');
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 < "2023-02-25 09:57:30";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 09:57:50";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:27:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 13:27:50', '1', '', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:02:04";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:32:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 13:32:04', '1', '', '156.210.14.93', '', 'DESKTOP');
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 < "2023-02-25 10:02:04";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:02:09";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:32:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:32:10', '1', 'addsellBill', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:15:57";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:45:57", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:45:57', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:17:28";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:47:28", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:47:28', '4', 'addAndRetuen', '197.61.88.158', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063f9f4f5665ff
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 13:45:57', '063f9f4f5665ff', '1', '0.00', '0', '60', '1', '860', '800', '-800', '0', '7', '2023-02-25 13:47:28', '', '4', '0', 'نقدي','7', '0', '5', '0', 'نقدي', '5', '0', '', '','','','-1','0','0','0','','0','-800','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '4' 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 ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','3704', '0', '2023-02-25 13:47:28', '4', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '800', '0', null, '0', null, null,'', '0','1','1','0','1');
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) VALUES ('200.00', '01128', '3704', '1', '1128', '1', '200', '200', '0', '', '0', '0', '1128', '0.00', '0','7','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
                where returnsellbilldetailid = 7849;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1128, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 213.953488372, 200, 200, 200
                    , 200, 200, 0, 0, 1)
                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
                        , returnSellVal = returnSellVal+213.953488372, returnSellCostBuyPrice = returnSellCostBuyPrice+200, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+200
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+200, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+200
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+200
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (7, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 213.953488372, 200, 200, 200
                    , 200, 200, 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
                        , returnSellVal = returnSellVal+213.953488372, returnSellCostBuyPrice = returnSellCostBuyPrice+200, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+200
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+200, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+200
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+200
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '31', userid = '4', storedetaildate = '2023-02-25 13:47:28' WHERE storedetailid = '4128';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1128', '7', '1', '0', '3704', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '30.00', '31', '4', '2023-02-25 13:47:28','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) VALUES ('180.00', '00802', '3704', '1', '802', '1', '180', '180', '0', '', '0', '0', '802', '0.00', '0','7','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 180.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 180.00, meanbuyprice_withDiscount = 180.00
                where returnsellbilldetailid = 7850;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (802, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 192.558139535, 180, 180, 180
                    , 180, 180, 0, 0, 1)
                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
                        , returnSellVal = returnSellVal+192.558139535, returnSellCostBuyPrice = returnSellCostBuyPrice+180, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+180
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+180, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+180
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+180
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (7, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 192.558139535, 180, 180, 180
                    , 180, 180, 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
                        , returnSellVal = returnSellVal+192.558139535, returnSellCostBuyPrice = returnSellCostBuyPrice+180, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+180
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+180, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+180
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+180
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '4', userid = '4', storedetaildate = '2023-02-25 13:47:28' WHERE storedetailid = '2453';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('802', '7', '1', '0', '3704', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '3.00', '4', '4', '2023-02-25 13:47:28','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) VALUES ('155.00', '00017', '3704', '1', '17', '1', '155', '155', '0', '', '0', '0', '17', '0.00', '0','7','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 170.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 170.00
                where returnsellbilldetailid = 7851;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (17, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 165.813953488, 155, 185, 170
                    , 185, 170, 0, 0, 1)
                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
                        , returnSellVal = returnSellVal+165.813953488, returnSellCostBuyPrice = returnSellCostBuyPrice+155, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+185
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+170, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+185
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+170
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (7, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 165.813953488, 155, 185, 170
                    , 185, 170, 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
                        , returnSellVal = returnSellVal+165.813953488, returnSellCostBuyPrice = returnSellCostBuyPrice+155, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+185
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+170, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+185
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+170
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '22', userid = '4', storedetaildate = '2023-02-25 13:47:28' WHERE storedetailid = '1226';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('17', '7', '1', '0', '3704', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '21.00', '22', '4', '2023-02-25 13:47:28','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) VALUES ('120.00', '00362', '3704', '1', '362', '1', '150', '150', '0', '', '0', '0', '362', '0.00', '0','7','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 120.00 , meanbuyprice = 120.00, lastbuyprice_withDiscount = 120.00, meanbuyprice_withDiscount = 120.00
                where returnsellbilldetailid = 7852;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (362, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 160.465116279, 120, 120, 120
                    , 120, 120, 0, 0, 1)
                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
                        , returnSellVal = returnSellVal+160.465116279, returnSellCostBuyPrice = returnSellCostBuyPrice+120, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+120
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+120, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+120
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+120
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (7, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 160.465116279, 120, 120, 120
                    , 120, 120, 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
                        , returnSellVal = returnSellVal+160.465116279, returnSellCostBuyPrice = returnSellCostBuyPrice+120, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+120
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+120, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+120
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+120
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '11', userid = '4', storedetaildate = '2023-02-25 13:47:28' WHERE storedetailid = '1707';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('362', '7', '1', '0', '3704', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '10.00', '11', '4', '2023-02-25 13:47:28','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) VALUES ('175.00', '00026', '3704', '1', '26', '1', '175', '175', '0', '', '0', '0', '26', '0.00', '0','7','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 180.00
                where returnsellbilldetailid = 7853;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (26, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 187.209302326, 175, 185, 180
                    , 185, 180, 0, 0, 1)
                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
                        , returnSellVal = returnSellVal+187.209302326, returnSellCostBuyPrice = returnSellCostBuyPrice+175, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+185
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+180, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+185
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+180
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (7, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 187.209302326, 175, 185, 180
                    , 185, 180, 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
                        , returnSellVal = returnSellVal+187.209302326, returnSellCostBuyPrice = returnSellCostBuyPrice+175, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+185
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+180, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+185
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+180
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '27', userid = '4', storedetaildate = '2023-02-25 13:47:28' WHERE storedetailid = '1235';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('26', '7', '1', '0', '3704', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '26.00', '27', '4', '2023-02-25 13:47:28','0','0');
UPDATE save SET  savecurrentvalue = '-270',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('530.00','800', '1', '7', 'اضافة فاتورة مردوات مبيعات', '3704', '-270', '2023-02-25 13:47:28', '4',  'returnsellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 800, 830, 870, 850
                    , 870, 850, 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
                        , returnSellVal = returnSellVal+800, returnSellCostBuyPrice = returnSellCostBuyPrice+830, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+870
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+850, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+870
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+850
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 800, 830, 870, 850
                    , 870, 850, 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
                        , returnSellVal = returnSellVal+800, returnSellCostBuyPrice = returnSellCostBuyPrice+830, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+870
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+850, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+870
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+850
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, -800, -830, -870
                    , -850, -870, -850, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-800, netSellCostBuyPrice = netSellCostBuyPrice+-830
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-870
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-850
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-870
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-850
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063f9f4f5665ff and sellbillId = 3704 and returnsellbillId = 3704
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:17:29";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:47:29", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:47:29', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:19:05";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:49:05", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:49:05', '4', 'addAndRetuen', '197.61.88.158', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063f9e7c02609f
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 12:49:36', '063f9e7c02609f', '1', '0.00', '0', '445', '1', '2545', '2100', '2100', '0', '7', '2023-02-25 13:49:05', '', '4', '0', 'نقدي', '7', '0', '3', '0', 'نقدي', '11' ,'0','','','','','-1','0','0','0','0','0','2100','0','','0','0','2100','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '4' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10366', '0', '2023-02-25 13:49:05', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2100', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 8818;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('210','01114', '10366', '1', '1114', '1', '210', '210', '0', '', '0', '2023-02-25 13:49:05', '1114', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','8818-1,');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
                where sellbilldetailid = 30225;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1114, '2023-02-25', 173.280943026, 210, 210
                    , 210, 210, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+173.280943026, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 173.280943026, 210, 210
                    , 210, 210, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+173.280943026, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '51', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '4049';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1114', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '52.00', '51', '4', '2023-02-25 13:49:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10205;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('150','01143', '10366', '1', '1143', '1', '150', '150', '0', '', '0', '2023-02-25 13:49:05', '1143', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','10205-1,');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
                where sellbilldetailid = 30226;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1143, '2023-02-25', 123.772102161, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+123.772102161, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 123.772102161, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+123.772102161, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '23', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '4308';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1143', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24.00', '23', '4', '2023-02-25 13:49:05','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) VALUES ('210','01012', '10366', '1', '1012', '1', '210', '210', '0', '', '0', '2023-02-25 13:49:05', '1012', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
                where sellbilldetailid = 30227;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1012, '2023-02-25', 173.280943026, 210, 210
                    , 210, 210, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+173.280943026, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 173.280943026, 210, 210
                    , 210, 210, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+173.280943026, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '25', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '3469';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1012', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26.00', '25', '4', '2023-02-25 13:49:05','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) VALUES ('210','01122', '10366', '1', '1122', '1', '220', '220', '0', '', '0', '2023-02-25 13:49:05', '1122', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
                where sellbilldetailid = 30228;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1122, '2023-02-25', 181.532416503, 210, 210
                    , 210, 210, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+181.532416503, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 181.532416503, 210, 210
                    , 210, 210, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+181.532416503, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '17', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '4101';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1122', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18.00', '17', '4', '2023-02-25 13:49:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10927;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('270','01162', '10366', '1', '1162', '1', '270', '270', '0', '', '0', '2023-02-25 13:49:05', '1162', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','10927-1,');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
                where sellbilldetailid = 30229;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1162, '2023-02-25', 222.78978389, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+222.78978389, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 222.78978389, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+222.78978389, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '3', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '4242';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1162', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4.00', '3', '4', '2023-02-25 13:49:05','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) VALUES ('220','00617', '10366', '1', '617', '1', '225', '225', '0', '', '0', '2023-02-25 13:49:05', '617', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
                where sellbilldetailid = 30230;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (617, '2023-02-25', 185.658153242, 220, 220
                    , 220, 220, 220, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185.658153242, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 185.658153242, 220, 220
                    , 220, 220, 220, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185.658153242, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '3', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '1889';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('617', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4.00', '3', '4', '2023-02-25 13:49:05','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) VALUES ('265','01129', '10366', '1', '1129', '1', '265', '265', '0', '', '0', '2023-02-25 13:49:05', '1129', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 265.00, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 265.00
                where sellbilldetailid = 30231;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1129, '2023-02-25', 218.664047151, 265, 265
                    , 265, 265, 265, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+218.664047151, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 218.664047151, 265, 265
                    , 265, 265, 265, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+218.664047151, sellCostBuyPrice =sellCostBuyPrice+265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '-1', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '4146';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1129', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0.00', '-1', '4', '2023-02-25 13:49:05','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) VALUES ('150','00565', '10366', '1', '565', '1', '230', '230', '0', '', '0', '2023-02-25 13:49:05', '565', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
                where sellbilldetailid = 30232;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (565, '2023-02-25', 189.78388998, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+189.78388998, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 189.78388998, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+189.78388998, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '-1', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '1514';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('565', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '0.00', '-1', '4', '2023-02-25 13:49:05','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) VALUES ('260','01165', '10366', '1', '1165', '1', '270', '270', '0', '', '0', '2023-02-25 13:49:05', '1165', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
                where sellbilldetailid = 30233;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1165, '2023-02-25', 222.78978389, 260, 260
                    , 260, 260, 260, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+222.78978389, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 222.78978389, 260, 260
                    , 260, 260, 260, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+222.78978389, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '9', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '4263';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1165', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10.00', '9', '4', '2023-02-25 13:49:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 2008;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('220','00585', '10366', '1', '585', '1', '225', '225', '0', '', '0', '2023-02-25 13:49:05', '585', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','2008-1,');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
                where sellbilldetailid = 30234;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (585, '2023-02-25', 185.658153242, 220, 220
                    , 220, 220, 220, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185.658153242, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 185.658153242, 220, 220
                    , 220, 220, 220, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185.658153242, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '0', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '1555';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('585', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1.00', '0', '4', '2023-02-25 13:49:05','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10945;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('270','01171', '10366', '1', '1171', '1', '270', '270', '0', '', '0', '2023-02-25 13:49:05', '1171', '0.00', '0', '7','0','','','0','0','0','0','0','0','0','0','','10945-1,');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
                where sellbilldetailid = 30235;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1171, '2023-02-25', 222.78978389, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+222.78978389, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 222.78978389, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+222.78978389, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '13', userid = '4', storedetaildate = '2023-02-25 13:49:05' WHERE storedetailid = '4303';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1171', '7', '1', '1', '10366', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14.00', '13', '4', '2023-02-25 13:49:05','0','0');
UPDATE save SET  savecurrentvalue = '1830',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('-270.00','2100', '0', '7', 'اضافة فاتورة مبيعات', '10366', '1830', '2023-02-25 13:49:05', '4',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 2100, 2435, 2435
                    , 2435, 2435, 2435, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2435
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2435, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2435
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2435, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2435
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 2100, 2435, 2435
                    , 2435, 2435, 2435, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2435
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2435, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2435
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2435, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2435
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 2100, 2435, 2435
                    , 2435, 2435, 2435, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2100, netSellCostBuyPrice = netSellCostBuyPrice+2435
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2435
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2435
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2435
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2435
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063f9e7c02609f and sellbillId = 10366 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:19:05";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:49:06", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:49:06', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:19:07";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:49:07", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 13:49:08', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:19:11";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:49:11", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('returnsellbillController.php', '2023-02-25 13:49:11', '4', 'showDetail', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:19:14";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:49:14", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:49:14', '4', 'showDetail', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:19:28";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:49:28", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:49:28', '4', 'showDetail', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:19:46";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:49:46", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 13:49:46', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:19:49";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:49:49", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:49:49', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:21:43";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:51:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 13:51:43', '1', 'add', '156.210.14.93', '', 'DESKTOP');
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 deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,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,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment ,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            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;
;;

;
BEGIN;
CALL insertUniqueOptNum(1268,7,1,569,63,'2023-02-25',1,0, '' ,0,0,0,0,0,'2023-02-25 13:51:43',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2064';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 7, 569, 0, 0
                    , 210.00, 31, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-31, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 569, 0, 0
                    , 210.00, -32, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "31*2022-02-22*210.00,32*2023-02-25*210.00," WHERE transferproductid = 5522;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('569', '7', '63', '1', '5522', 'تحويل منتجات من المخزن', 'storemovementController.php', '65.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '358', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1528';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 569, 0, 0
                    , 210.00, 31, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+31, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 569, 0, 0
                    , 210.00, 32, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('569', '1', '63', '0', '5522', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '295.00', '358', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '471', '26', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3468';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-28', 7, 471, 0, 0
                    , 165.00, 23, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-23, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 471, 0, 0
                    , 165.00, -3, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 165.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "23*2022-04-28*165.00,3*2023-02-25*165.00," WHERE transferproductid = 5523;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('471', '7', '26', '1', '5523', 'تحويل منتجات من المخزن', 'storemovementController.php', '26.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '52', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '471';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-28', 1, 471, 0, 0
                    , 165.00, 23, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+23, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 471, 0, 0
                    , 165.00, 3, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('471', '1', '26', '0', '5523', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '26.00', '52', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '467', '47', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3078';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 7, 467, 0, 0
                    , 165.00, 15, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-28', 7, 467, 0, 0
                    , 165.00, 28, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-28, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 467, 0, 0
                    , 165.00, -4, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 165.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "15*2022-04-11*165.00,28*2022-04-28*165.00,4*2023-02-25*165.00," WHERE transferproductid = 5524;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('467', '7', '47', '1', '5524', 'تحويل منتجات من المخزن', 'storemovementController.php', '56.00', '9', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '162', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '467';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 467, 0, 0
                    , 165.00, 15, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-28', 1, 467, 0, 0
                    , 165.00, 28, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 467, 0, 0
                    , 165.00, 4, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('467', '1', '47', '0', '5524', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '115.00', '162', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '233', '1', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1854';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 233, 0, 0
                    , 175.00, -1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 175.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*175.00," WHERE transferproductid = 5525;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('233', '7', '1', '1', '5525', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '61', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '233';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 233, 0, 0
                    , 175.00, 1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('233', '1', '1', '0', '5525', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '60.00', '61', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '537', '32', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1673';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 7, 537, 0, 0
                    , 195.00, 22, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-22, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 537, 0, 0
                    , 195.00, -10, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "22*2021-12-12*195.00,10*2023-02-25*195.00," WHERE transferproductid = 5526;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('537', '7', '32', '1', '5526', 'تحويل منتجات من المخزن', 'storemovementController.php', '30.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '537';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 1, 537, 0, 0
                    , 195.00, 22, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+22, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 537, 0, 0
                    , 195.00, 10, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('537', '1', '32', '0', '5526', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '16.00', '48', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '80', '25', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1251';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 7, 80, 0, 0
                    , 200.00, 25, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-25, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "25*2021-11-08*200.00," WHERE transferproductid = 5527;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '7', '25', '1', '5527', 'تحويل منتجات من المخزن', 'storemovementController.php', '28.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '80';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 80, 0, 0
                    , 200.00, 25, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+25, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '1', '25', '0', '5527', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '26.00', '51', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '11', '16', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-16', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1221';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 7, 11, 0, 0
                    , 170.00, 16, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-16, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2021-11-08*170.00," WHERE transferproductid = 5528;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11', '7', '16', '1', '5528', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-16', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '11';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 11, 0, 0
                    , 170.00, 16, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('11', '1', '16', '0', '5528', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '16', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '575', '18', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2689';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-20', 7, 575, 0, 0
                    , 185.00, 4, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-4, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 575, 0, 0
                    , 185.00, -14, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 185.00,
                        buyQuantity =buyQuantity+-14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2022-03-20*185.00,14*2023-02-25*185.00," WHERE transferproductid = 5529;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('575', '7', '18', '1', '5529', 'تحويل منتجات من المخزن', 'storemovementController.php', '18.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1535';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-20', 1, 575, 0, 0
                    , 185.00, 4, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 575, 0, 0
                    , 185.00, 14, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('575', '1', '18', '0', '5529', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '2.00', '20', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '581', '4', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2691';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-20', 7, 581, 0, 0
                    , 185.00, 3, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 581, 0, 0
                    , 185.00, -1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 185.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2022-03-20*185.00,1*2023-02-25*185.00," WHERE transferproductid = 5530;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('581', '7', '4', '1', '5530', 'تحويل منتجات من المخزن', 'storemovementController.php', '4.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1541';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-20', 1, 581, 0, 0
                    , 185.00, 3, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 581, 0, 0
                    , 185.00, 1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('581', '1', '4', '0', '5530', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '20.00', '24', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '228', '1', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1859';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 228, 0, 0
                    , 205.00, -1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 205.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*205.00," WHERE transferproductid = 5531;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('228', '7', '1', '1', '5531', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '228';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 228, 0, 0
                    , 205.00, 1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('228', '1', '1', '0', '5531', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '1.00', '2', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '658', '24', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2081';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 658, 0, 0
                    , 215.00, -24, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 215.00,
                        buyQuantity =buyQuantity+-24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2023-02-25*215.00," WHERE transferproductid = 5532;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('658', '7', '24', '1', '5532', 'تحويل منتجات من المخزن', 'storemovementController.php', '24.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1939';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 658, 0, 0
                    , 215.00, 24, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('658', '1', '24', '0', '5532', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '8.00', '32', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '536', '54', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1679';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 7, 536, 0, 0
                    , 195.00, 52, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-52, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 536, 0, 0
                    , 195.00, -2, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "52*2021-12-12*195.00,2*2023-02-25*195.00," WHERE transferproductid = 5533;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('536', '7', '54', '1', '5533', 'تحويل منتجات من المخزن', 'storemovementController.php', '54.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '69', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '536';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 1, 536, 0, 0
                    , 195.00, 52, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+52, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 536, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('536', '1', '54', '0', '5533', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '15.00', '69', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '85', '25', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1680';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 7, 85, 0, 0
                    , 205.00, 25, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-25, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "25*2021-12-12*205.00," WHERE transferproductid = 5534;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('85', '7', '25', '1', '5534', 'تحويل منتجات من المخزن', 'storemovementController.php', '32.00', '7', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '41', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '85';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 1, 85, 0, 0
                    , 205.00, 25, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+25, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('85', '1', '25', '0', '5534', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '16.00', '41', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '468', '31', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3994';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 7, 468, 0, 0
                    , 165.00, 31, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-31, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "31*2022-07-19*165.00," WHERE transferproductid = 5535;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('468', '7', '31', '1', '5535', 'تحويل منتجات من المخزن', 'storemovementController.php', '31.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-29', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '468';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 1, 468, 0, 0
                    , 165.00, 31, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+31, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('468', '1', '31', '0', '5535', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-60.00', '-29', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '635', '24', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '12', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2077';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 7, 635, 0, 0
                    , 210.00, 19, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-19, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 635, 0, 0
                    , 210.00, -5, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "19*2022-02-22*210.00,5*2023-02-25*210.00," WHERE transferproductid = 5536;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('635', '7', '24', '1', '5536', 'تحويل منتجات من المخزن', 'storemovementController.php', '36.00', '12', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '199', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1912';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 635, 0, 0
                    , 210.00, 19, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+19, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 635, 0, 0
                    , 210.00, 5, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('635', '1', '24', '0', '5536', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '175.00', '199', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '538', '54', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1674';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 7, 538, 0, 0
                    , 195.00, 54, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-54, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "54*2021-12-12*195.00," WHERE transferproductid = 5537;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('538', '7', '54', '1', '5537', 'تحويل منتجات من المخزن', 'storemovementController.php', '54.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '309', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '538';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 1, 538, 0, 0
                    , 195.00, 54, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+54, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('538', '1', '54', '0', '5537', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '255.00', '309', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '420', '2', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3273';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 7, 420, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 420, 0, 0
                    , 145.00, -1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-04-18*145.00,1*2023-02-25*145.00," WHERE transferproductid = 5538;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('420', '7', '2', '1', '5538', 'تحويل منتجات من المخزن', 'storemovementController.php', '6.00', '4', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '420';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 420, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 420, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('420', '1', '2', '0', '5538', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '2', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '671', '7', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2057';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 671, 0, 0
                    , 180.00, -7, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2023-02-25*180.00," WHERE transferproductid = 5539;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('671', '7', '7', '1', '5539', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1955';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 671, 0, 0
                    , 180.00, 7, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('671', '1', '7', '0', '5539', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '2.00', '9', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '416', '8', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3275';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 7, 416, 0, 0
                    , 140.00, 8, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2022-07-19*140.00," WHERE transferproductid = 5540;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('416', '7', '8', '1', '5540', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '5', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '416';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 1, 416, 0, 0
                    , 140.00, 8, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('416', '1', '8', '0', '5540', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-1.00', '7', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '283', '7', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '14', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1811';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 7, 283, 0, 0
                    , 150.00, 4, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-4, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 7, 283, 0, 0
                    , 150.00, 3, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2022-07-19*150.00,3*2022-07-21*150.00," WHERE transferproductid = 5541;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('283', '7', '7', '1', '5541', 'تحويل منتجات من المخزن', 'storemovementController.php', '21.00', '14', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '44', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '283';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 1, 283, 0, 0
                    , 150.00, 4, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 283, 0, 0
                    , 150.00, 3, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('283', '1', '7', '0', '5541', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '37.00', '44', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '185', '21', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3276';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 7, 185, 0, 0
                    , 180.00, 21, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-21, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "21*2022-04-18*180.00," WHERE transferproductid = 5542;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('185', '7', '21', '1', '5542', 'تحويل منتجات من المخزن', 'storemovementController.php', '23.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '21', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '185';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 185, 0, 0
                    , 180.00, 21, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('185', '1', '21', '0', '5542', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '21', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '412', '34', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2058';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 412, 0, 0
                    , 140.00, -34, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-34, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "34*2023-02-25*140.00," WHERE transferproductid = 5543;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '7', '34', '1', '5543', 'تحويل منتجات من المخزن', 'storemovementController.php', '27.00', '-7', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '45', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '412';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 412, 0, 0
                    , 140.00, 34, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+34, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '1', '34', '0', '5543', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '11.00', '45', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '284', '18', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-17', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1810';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 284, 0, 0
                    , 150.00, -18, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 150.00,
                        buyQuantity =buyQuantity+-18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2023-02-25*150.00," WHERE transferproductid = 5544;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('284', '7', '18', '1', '5544', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '-17', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '284';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 284, 0, 0
                    , 150.00, 18, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('284', '1', '18', '0', '5544', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '18', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '681', '15', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3992';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 7, 681, 0, 0
                    , 155.00, 15, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "15*2022-07-19*155.00," WHERE transferproductid = 5545;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('681', '7', '15', '1', '5545', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '151', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1965';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 1, 681, 0, 0
                    , 155.00, 15, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('681', '1', '15', '0', '5545', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '136.00', '151', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '281', '25', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-11', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1813';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 7, 281, 0, 0
                    , 150.00, 4, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-4, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 281, 0, 0
                    , 150.00, -21, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 150.00,
                        buyQuantity =buyQuantity+-21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2022-04-18*150.00,21*2023-02-25*150.00," WHERE transferproductid = 5546;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('281', '7', '25', '1', '5546', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '-11', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '41', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '281';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 281, 0, 0
                    , 150.00, 4, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 281, 0, 0
                    , 150.00, 21, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('281', '1', '25', '0', '5546', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '16.00', '41', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '417', '16', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3277';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 7, 417, 0, 0
                    , 140.00, 9, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 417, 0, 0
                    , 140.00, -7, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-04-18*140.00,7*2023-02-25*140.00," WHERE transferproductid = 5547;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('417', '7', '16', '1', '5547', 'تحويل منتجات من المخزن', 'storemovementController.php', '17.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '417';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 417, 0, 0
                    , 140.00, 9, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 417, 0, 0
                    , 140.00, 7, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('417', '1', '16', '0', '5547', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '16', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '280', '17', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1814';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 7, 280, 0, 0
                    , 150.00, 17, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-17, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "17*2022-04-18*150.00," WHERE transferproductid = 5548;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('280', '7', '17', '1', '5548', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '33', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '280';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 280, 0, 0
                    , 150.00, 17, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+17, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('280', '1', '17', '0', '5548', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '16.00', '33', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '294', '18', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1800';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 294, 0, 0
                    , 180.00, -18, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2023-02-25*180.00," WHERE transferproductid = 5549;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('294', '7', '18', '1', '5549', 'تحويل منتجات من المخزن', 'storemovementController.php', '18.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '294';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 294, 0, 0
                    , 180.00, 18, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('294', '1', '18', '0', '5549', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '18', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '429', '18', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2076';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 429, 0, 0
                    , 170.00, -18, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2023-02-25*170.00," WHERE transferproductid = 5550;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('429', '7', '18', '1', '5550', 'تحويل منتجات من المخزن', 'storemovementController.php', '17.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '429';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 429, 0, 0
                    , 170.00, 18, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('429', '1', '18', '0', '5550', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '10.00', '28', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '418', '21', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3074';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 7, 418, 0, 0
                    , 140.00, 2, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 7, 418, 0, 0
                    , 140.00, 19, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-19, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2022-04-18*140.00,19*2022-07-19*140.00," WHERE transferproductid = 5551;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('418', '7', '21', '1', '5551', 'تحويل منتجات من المخزن', 'storemovementController.php', '22.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '418';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 418, 0, 0
                    , 140.00, 2, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 1, 418, 0, 0
                    , 140.00, 19, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+19, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('418', '1', '21', '0', '5551', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-1.00', '20', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '669', '33', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2062';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 669, 0, 0
                    , 180.00, -33, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-33, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "33*2023-02-25*180.00," WHERE transferproductid = 5552;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('669', '7', '33', '1', '5552', 'تحويل منتجات من المخزن', 'storemovementController.php', '39.00', '6', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '45', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1953';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 669, 0, 0
                    , 180.00, 33, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+33, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('669', '1', '33', '0', '5552', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '12.00', '45', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '413', '14', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3278';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 7, 413, 0, 0
                    , 140.00, 12, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 413, 0, 0
                    , 140.00, -2, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2022-04-18*140.00,2*2023-02-25*140.00," WHERE transferproductid = 5553;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('413', '7', '14', '1', '5553', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '165', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '413';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-18', 1, 413, 0, 0
                    , 140.00, 12, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 413, 0, 0
                    , 140.00, 2, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('413', '1', '14', '0', '5553', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '151.00', '165', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '283', '20', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1811';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 7, 283, 0, 0
                    , 150.00, 12, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 283, 0, 0
                    , 150.00, -8, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 150.00,
                        buyQuantity =buyQuantity+-8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2022-07-21*150.00,8*2023-02-25*150.00," WHERE transferproductid = 5554;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('283', '7', '20', '1', '5554', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '-6', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '64', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '283';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 283, 0, 0
                    , 150.00, 12, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 283, 0, 0
                    , 150.00, 8, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('283', '1', '20', '0', '5554', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '44.00', '64', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '415', '19', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3076';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 7, 415, 0, 0
                    , 140.00, 19, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-19, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "19*2022-04-11*140.00," WHERE transferproductid = 5555;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('415', '7', '19', '1', '5555', 'تحويل منتجات من المخزن', 'storemovementController.php', '20.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '67', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '415';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 415, 0, 0
                    , 140.00, 19, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+19, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('415', '1', '19', '0', '5555', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '48.00', '67', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '432', '17', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3773';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-10', 7, 432, 0, 0
                    , 125.00, 15, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 432, 0, 0
                    , 125.00, -2, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 125.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "15*2022-06-10*125.00,2*2023-02-25*125.00," WHERE transferproductid = 5556;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('432', '7', '17', '1', '5556', 'تحويل منتجات من المخزن', 'storemovementController.php', '17.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '114', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '432';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-10', 1, 432, 0, 0
                    , 125.00, 15, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 432, 0, 0
                    , 125.00, 2, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('432', '1', '17', '0', '5556', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '97.00', '114', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '781', '18', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3079';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 7, 781, 0, 0
                    , 130.00, 18, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-18, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2022-04-11*130.00," WHERE transferproductid = 5557;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('781', '7', '18', '1', '5557', 'تحويل منتجات من المخزن', 'storemovementController.php', '22.00', '4', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '502', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2362';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 781, 0, 0
                    , 130.00, 18, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('781', '1', '18', '0', '5557', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '484.00', '502', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '192', '28', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4061';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 7, 192, 0, 0
                    , 155.00, 27, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-27, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 192, 0, 0
                    , 155.00, -1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "27*2022-07-21*155.00,1*2023-02-25*155.00," WHERE transferproductid = 5558;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('192', '7', '28', '1', '5558', 'تحويل منتجات من المخزن', 'storemovementController.php', '27.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-30', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '192';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 192, 0, 0
                    , 155.00, 27, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+27, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 192, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('192', '1', '28', '0', '5558', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-58.00', '-30', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '620', '32', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4060';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 7, 620, 0, 0
                    , 185.00, 32, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-32, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "32*2022-07-21*185.00," WHERE transferproductid = 5559;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('620', '7', '32', '1', '5559', 'تحويل منتجات من المخزن', 'storemovementController.php', '32.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-45', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1897';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 620, 0, 0
                    , 185.00, 32, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('620', '1', '32', '0', '5559', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-77.00', '-45', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '621', '14', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3732';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-08', 7, 621, 0, 0
                    , 185.00, 14, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-14, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "14*2022-06-08*185.00," WHERE transferproductid = 5560;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('621', '7', '14', '1', '5560', 'تحويل منتجات من المخزن', 'storemovementController.php', '32.00', '18', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-25', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1898';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-08', 1, 621, 0, 0
                    , 185.00, 14, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('621', '1', '14', '0', '5560', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-39.00', '-25', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '108', '38', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1874';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 7, 108, 0, 0
                    , 160.00, 36, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-36, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 108, 0, 0
                    , 160.00, -2, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 160.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "36*2022-07-21*160.00,2*2023-02-25*160.00," WHERE transferproductid = 5561;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('108', '7', '38', '1', '5561', 'تحويل منتجات من المخزن', 'storemovementController.php', '37.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '89', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '108';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 108, 0, 0
                    , 160.00, 36, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 108, 0, 0
                    , 160.00, 2, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('108', '1', '38', '0', '5561', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '51.00', '89', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '107', '18', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3077';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 7, 107, 0, 0
                    , 155.00, 18, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-18, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2022-04-11*155.00," WHERE transferproductid = 5562;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('107', '7', '18', '1', '5562', 'تحويل منتجات من المخزن', 'storemovementController.php', '26.00', '8', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '93', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '107';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 107, 0, 0
                    , 155.00, 18, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('107', '1', '18', '0', '5562', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '75.00', '93', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '674', '33', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '29', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2059';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 7, 674, 0, 0
                    , 145.00, 24, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 674, 0, 0
                    , 145.00, -9, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2022-02-22*145.00,9*2023-02-25*145.00," WHERE transferproductid = 5563;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('674', '7', '33', '1', '5563', 'تحويل منتجات من المخزن', 'storemovementController.php', '62.00', '29', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '125', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1958';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 674, 0, 0
                    , 145.00, 24, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 674, 0, 0
                    , 145.00, 9, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('674', '1', '33', '0', '5563', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '92.00', '125', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '24', '16', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '17', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1233';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 7, 24, 0, 0
                    , 170.00, -16, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-02-25*170.00," WHERE transferproductid = 5564;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('24', '7', '16', '1', '5564', 'تحويل منتجات من المخزن', 'storemovementController.php', '33.00', '17', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '38', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '24';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 24, 0, 0
                    , 170.00, 16, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('24', '1', '16', '0', '5564', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '22.00', '38', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '90', '48', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1258';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 7, 90, 0, 0
                    , 165.00, 36, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-36, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 7, 90, 0, 0
                    , 165.00, 12, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "36*2021-11-08*165.00,12*2021-12-12*165.00," WHERE transferproductid = 5565;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('90', '7', '48', '1', '5565', 'تحويل منتجات من المخزن', 'storemovementController.php', '51.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '68', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '90';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 90, 0, 0
                    , 165.00, 36, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-12', 1, 90, 0, 0
                    , 165.00, 12, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('90', '1', '48', '0', '5565', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '20.00', '68', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '641', '27', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '38', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2068';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 7, 641, 0, 0
                    , 140.00, 27, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-27, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "27*2022-02-22*140.00," WHERE transferproductid = 5566;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('641', '7', '27', '1', '5566', 'تحويل منتجات من المخزن', 'storemovementController.php', '65.00', '38', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '76', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1920';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 641, 0, 0
                    , 140.00, 27, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+27, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('641', '1', '27', '0', '5566', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '49.00', '76', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('7', '1', '639', '23', '2023-02-25', '1', '0','1268',null,null,'2023-02-25 13:51:44',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2067';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 7, 639, 0, 0
                    , 125.00, 23, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-23, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "23*2022-02-22*125.00," WHERE transferproductid = 5567;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('639', '7', '23', '1', '5567', 'تحويل منتجات من المخزن', 'storemovementController.php', '55.00', '32', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '91', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1918';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-22', 1, 639, 0, 0
                    , 125.00, 23, 0, 0, 1, '2023-02-25 13:51:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+23, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 13:51:44' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('639', '1', '23', '0', '5567', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '68.00', '91', '1', '2023-02-25','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:21:44";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:51:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 13:51:45', '1', 'editshow', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:23:26";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 13:53:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 13:53:26', '1', '', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:25:58";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:55:58", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 13:55:58', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:26:03";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 13:56:03", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 13:56:03', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:36:49";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 14:06:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 14:06:49', '1', 'add', '156.210.14.93', '', 'DESKTOP');
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 deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,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,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment ,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            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;
;;

;
BEGIN;
CALL insertUniqueOptNum(1269,6,1,528,11,'2023-02-25',1,0, '' ,0,0,0,0,0,'2023-02-25 14:06:49',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '945';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 528, 0, 0
                    , 195.00, 10, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 528, 0, 0
                    , 195.00, -1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2021-11-08*195.00,1*2023-02-25*195.00," WHERE transferproductid = 5568;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('528', '6', '11', '1', '5568', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '22', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '528';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 528, 0, 0
                    , 195.00, 10, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 528, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('528', '1', '11', '0', '5568', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '11.00', '22', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '527', '11', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1033';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 527, 0, 0
                    , 195.00, 11, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-11, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "11*2021-11-08*195.00," WHERE transferproductid = 5569;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('527', '6', '11', '1', '5569', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '31', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '527';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 527, 0, 0
                    , 195.00, 11, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('527', '1', '11', '0', '5569', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '20.00', '31', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '533', '13', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1032';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 533, 0, 0
                    , 195.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2021-11-08*195.00," WHERE transferproductid = 5570;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('533', '6', '13', '1', '5570', 'تحويل منتجات من المخزن', 'storemovementController.php', '12.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '533';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 533, 0, 0
                    , 195.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('533', '1', '13', '0', '5570', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '37.00', '50', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '181', '11', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1922';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 181, 0, 0
                    , 195.00, -11, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "11*2023-02-25*195.00," WHERE transferproductid = 5571;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('181', '6', '11', '1', '5571', 'تحويل منتجات من المخزن', 'storemovementController.php', '12.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '79', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '181';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 181, 0, 0
                    , 195.00, 11, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('181', '1', '11', '0', '5571', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '68.00', '79', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '537', '13', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1019';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 537, 0, 0
                    , 195.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2021-11-08*195.00," WHERE transferproductid = 5572;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('537', '6', '13', '1', '5572', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '61', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '537';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 537, 0, 0
                    , 195.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('537', '1', '13', '0', '5572', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '48.00', '61', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '534', '17', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-17', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1035';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 534, 0, 0
                    , 195.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 534, 0, 0
                    , 195.00, -4, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2021-11-08*195.00,4*2023-02-25*195.00," WHERE transferproductid = 5573;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('534', '6', '17', '1', '5573', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-17', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '534';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 534, 0, 0
                    , 195.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 534, 0, 0
                    , 195.00, 4, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('534', '1', '17', '0', '5573', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '33.00', '50', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '525', '3', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2621';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 6, 525, 0, 0
                    , 195.00, 3, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2022-03-16*195.00," WHERE transferproductid = 5574;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('525', '6', '3', '1', '5574', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '12', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '525';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 525, 0, 0
                    , 195.00, 3, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('525', '1', '3', '0', '5574', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '9.00', '12', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '526', '3', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1031';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 526, 0, 0
                    , 195.00, 3, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2021-11-08*195.00," WHERE transferproductid = 5575;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('526', '6', '3', '1', '5575', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '526';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 526, 0, 0
                    , 195.00, 3, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('526', '1', '3', '0', '5575', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '3', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '531', '2', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1030';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 531, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2021-11-08*195.00," WHERE transferproductid = 5576;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('531', '6', '2', '1', '5576', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '531';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 531, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('531', '1', '2', '0', '5576', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '2', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '80', '18', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4020';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 6, 80, 0, 0
                    , 200.00, 11, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-11, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 80, 0, 0
                    , 200.00, -7, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 200.00,
                        buyQuantity =buyQuantity+-7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "11*2022-07-21*200.00,7*2023-02-25*200.00," WHERE transferproductid = 5577;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '6', '18', '1', '5577', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '69', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '80';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 80, 0, 0
                    , 200.00, 11, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 80, 0, 0
                    , 200.00, 7, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('80', '1', '18', '0', '5577', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '51.00', '69', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '570', '28', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4018';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 6, 570, 0, 0
                    , 210.00, 26, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-26, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 570, 0, 0
                    , 210.00, -2, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "26*2022-07-21*210.00,2*2023-02-25*210.00," WHERE transferproductid = 5578;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('570', '6', '28', '1', '5578', 'تحويل منتجات من المخزن', 'storemovementController.php', '28.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '158', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1529';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 570, 0, 0
                    , 210.00, 26, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+26, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 570, 0, 0
                    , 210.00, 2, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('570', '1', '28', '0', '5578', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '130.00', '158', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '536', '25', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1022';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 536, 0, 0
                    , 195.00, 24, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 536, 0, 0
                    , 195.00, -1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2021-11-08*195.00,1*2023-02-25*195.00," WHERE transferproductid = 5579;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('536', '6', '25', '1', '5579', 'تحويل منتجات من المخزن', 'storemovementController.php', '22.00', '-3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '94', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '536';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 536, 0, 0
                    , 195.00, 24, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 536, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('536', '1', '25', '0', '5579', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '69.00', '94', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '532', '20', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1037';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 532, 0, 0
                    , 195.00, 20, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "20*2021-11-08*195.00," WHERE transferproductid = 5580;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('532', '6', '20', '1', '5580', 'تحويل منتجات من المخزن', 'storemovementController.php', '26.00', '6', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '140', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '532';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 532, 0, 0
                    , 195.00, 20, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('532', '1', '20', '0', '5580', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '120.00', '140', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '535', '24', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1036';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 535, 0, 0
                    , 195.00, 24, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2021-11-08*195.00," WHERE transferproductid = 5581;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('535', '6', '24', '1', '5581', 'تحويل منتجات من المخزن', 'storemovementController.php', '26.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '535';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 535, 0, 0
                    , 195.00, 24, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('535', '1', '24', '0', '5581', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '24', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '530', '6', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1026';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 530, 0, 0
                    , 195.00, 6, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2021-11-08*195.00," WHERE transferproductid = 5582;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('530', '6', '6', '1', '5582', 'تحويل منتجات من المخزن', 'storemovementController.php', '6.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '38', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '530';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 530, 0, 0
                    , 195.00, 6, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('530', '1', '6', '0', '5582', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '32.00', '38', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '182', '20', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4015';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 6, 182, 0, 0
                    , 180.00, 20, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "20*2022-07-21*180.00," WHERE transferproductid = 5583;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('182', '6', '20', '1', '5583', 'تحويل منتجات من المخزن', 'storemovementController.php', '21.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '20', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '182';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 182, 0, 0
                    , 180.00, 20, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('182', '1', '20', '0', '5583', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '20', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '258', '24', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4016';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 6, 258, 0, 0
                    , 190.00, 24, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2022-07-21*190.00," WHERE transferproductid = 5584;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('258', '6', '24', '1', '5584', 'تحويل منتجات من المخزن', 'storemovementController.php', '24.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-60', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '258';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 258, 0, 0
                    , 190.00, 24, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('258', '1', '24', '0', '5584', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-84.00', '-60', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '1021', '31', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3560';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-05-16', 6, 1021, 0, 0
                    , 290.00, 22, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-22, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 1021, 0, 0
                    , 290.00, -9, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 290.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "22*2022-05-16*290.00,9*2023-02-25*290.00," WHERE transferproductid = 5585;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1021', '6', '31', '1', '5585', 'تحويل منتجات من المخزن', 'storemovementController.php', '32.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '31', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3540';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-05-16', 1, 1021, 0, 0
                    , 290.00, 22, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+22, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1021, 0, 0
                    , 290.00, 9, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1021', '1', '31', '0', '5585', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '31', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '32', '12', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3059';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 6, 32, 0, 0
                    , 170.00, 12, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2022-04-11*170.00," WHERE transferproductid = 5586;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('32', '6', '12', '1', '5586', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '12', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '32';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 32, 0, 0
                    , 170.00, 12, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('32', '1', '12', '0', '5586', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '12', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '12', '22', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3061';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 6, 12, 0, 0
                    , 145.00, 22, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-22, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "22*2022-04-11*145.00," WHERE transferproductid = 5587;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '6', '22', '1', '5587', 'تحويل منتجات من المخزن', 'storemovementController.php', '22.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '151', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '12';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 12, 0, 0
                    , 145.00, 22, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+22, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '1', '22', '0', '5587', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '129.00', '151', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '66', '15', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3055';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 6, 66, 0, 0
                    , 175.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 66, 0, 0
                    , 175.00, -2, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 175.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2022-04-11*175.00,2*2023-02-25*175.00," WHERE transferproductid = 5588;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('66', '6', '15', '1', '5588', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '66';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 66, 0, 0
                    , 175.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 66, 0, 0
                    , 175.00, 2, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('66', '1', '15', '0', '5588', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '13.00', '28', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '480', '13', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '967';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 480, 0, 0
                    , 180.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2021-11-08*180.00," WHERE transferproductid = 5589;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('480', '6', '13', '1', '5589', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '13', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '480';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 480, 0, 0
                    , 180.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('480', '1', '13', '0', '5589', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '13', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '498', '13', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '958';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 498, 0, 0
                    , 170.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2021-11-08*170.00," WHERE transferproductid = 5590;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('498', '6', '13', '1', '5590', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '13', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '498';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 498, 0, 0
                    , 170.00, 13, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('498', '1', '13', '0', '5590', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '13', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '497', '14', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1025';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 497, 0, 0
                    , 165.00, 14, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-14, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "14*2021-11-08*165.00," WHERE transferproductid = 5591;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('497', '6', '14', '1', '5591', 'تحويل منتجات من المخزن', 'storemovementController.php', '12.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '14', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '497';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 497, 0, 0
                    , 165.00, 14, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('497', '1', '14', '0', '5591', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '14', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '7', '16', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3056';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 6, 7, 0, 0
                    , 145.00, 7, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-7, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 7, 0, 0
                    , 145.00, -9, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2022-04-15*145.00,9*2023-02-25*145.00," WHERE transferproductid = 5592;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('7', '6', '16', '1', '5592', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '52', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '7';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 7, 0, 0
                    , 145.00, 7, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 7, 0, 0
                    , 145.00, 9, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('7', '1', '16', '0', '5592', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '36.00', '52', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '24', '16', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3058';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 6, 24, 0, 0
                    , 170.00, 14, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-14, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 24, 0, 0
                    , 170.00, -2, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "14*2022-04-11*170.00,2*2023-02-25*170.00," WHERE transferproductid = 5593;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('24', '6', '16', '1', '5593', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '54', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '24';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 24, 0, 0
                    , 170.00, 14, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 24, 0, 0
                    , 170.00, 2, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('24', '1', '16', '0', '5593', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '38.00', '54', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '1', '19', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3060';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 6, 1, 0, 0
                    , 150.00, 19, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-19, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "19*2022-04-11*150.00," WHERE transferproductid = 5594;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '6', '19', '1', '5594', 'تحويل منتجات من المخزن', 'storemovementController.php', '20.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '110', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 1, 0, 0
                    , 150.00, 19, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+19, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '19', '0', '5594', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '91.00', '110', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '487', '21', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '968';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 487, 0, 0
                    , 140.00, 21, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-21, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "21*2021-11-08*140.00," WHERE transferproductid = 5595;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('487', '6', '21', '1', '5595', 'تحويل منتجات من المخزن', 'storemovementController.php', '23.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '29', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '487';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 487, 0, 0
                    , 140.00, 21, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('487', '1', '21', '0', '5595', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '8.00', '29', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '415', '20', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1010';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 6, 415, 0, 0
                    , 140.00, 11, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-11, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 6, 415, 0, 0
                    , 140.00, 9, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "11*2021-11-08*140.00,9*2022-04-11*140.00," WHERE transferproductid = 5596;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('415', '6', '20', '1', '5596', 'تحويل منتجات من المخزن', 'storemovementController.php', '20.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '87', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '415';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 415, 0, 0
                    , 140.00, 11, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 415, 0, 0
                    , 140.00, 9, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('415', '1', '20', '0', '5596', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '67.00', '87', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '185', '11', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3054';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 6, 185, 0, 0
                    , 180.00, 8, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 185, 0, 0
                    , 180.00, -3, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2022-04-11*180.00,3*2023-02-25*180.00," WHERE transferproductid = 5597;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('185', '6', '11', '1', '5597', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '185';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 185, 0, 0
                    , 180.00, 8, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 185, 0, 0
                    , 180.00, 3, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('185', '1', '11', '0', '5597', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '21.00', '32', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '432', '1', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3749';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-10', 6, 432, 0, 0
                    , 125.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-06-10*125.00," WHERE transferproductid = 5598;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('432', '6', '1', '1', '5598', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '15', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '115', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '432';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-10', 1, 432, 0, 0
                    , 125.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('432', '1', '1', '0', '5598', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '114.00', '115', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '416', '8', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1015';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 6, 416, 0, 0
                    , 140.00, 8, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2022-02-24*140.00," WHERE transferproductid = 5599;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('416', '6', '8', '1', '5599', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '416';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 416, 0, 0
                    , 140.00, 8, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('416', '1', '8', '0', '5599', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '7.00', '15', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '281', '6', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3343';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-19', 6, 281, 0, 0
                    , 150.00, 6, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2022-04-19*150.00," WHERE transferproductid = 5600;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('281', '6', '6', '1', '5600', 'تحويل منتجات من المخزن', 'storemovementController.php', '6.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '47', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '281';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-19', 1, 281, 0, 0
                    , 150.00, 6, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('281', '1', '6', '0', '5600', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '41.00', '47', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '95', '17', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4021';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 6, 95, 0, 0
                    , 145.00, 17, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-17, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "17*2022-07-21*145.00," WHERE transferproductid = 5601;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('95', '6', '17', '1', '5601', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '95';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 95, 0, 0
                    , 145.00, 17, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+17, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('95', '1', '17', '0', '5601', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-26.00', '-9', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '184', '37', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4086';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-01', 6, 184, 0, 0
                    , 150.00, 3, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-06', 6, 184, 0, 0
                    , 150.00, 26, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-26, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 184, 0, 0
                    , 150.00, -8, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 150.00,
                        buyQuantity =buyQuantity+-8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2022-08-01*150.00,26*2022-08-06*150.00,8*2023-02-25*150.00," WHERE transferproductid = 5602;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('184', '6', '37', '1', '5602', 'تحويل منتجات من المخزن', 'storemovementController.php', '30.00', '-7', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '37', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '184';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-01', 1, 184, 0, 0
                    , 150.00, 3, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-06', 1, 184, 0, 0
                    , 150.00, 26, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+26, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 184, 0, 0
                    , 150.00, 8, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('184', '1', '37', '0', '5602', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '37', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '781', '17', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4014';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 6, 781, 0, 0
                    , 130.00, 17, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-17, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "17*2022-07-21*130.00," WHERE transferproductid = 5603;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('781', '6', '17', '1', '5603', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '519', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2362';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 781, 0, 0
                    , 130.00, 17, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+17, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('781', '1', '17', '0', '5603', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '502.00', '519', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '421', '1', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1002';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 6, 421, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-03-16*145.00," WHERE transferproductid = 5604;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('421', '6', '1', '1', '5604', 'تحويل منتجات من المخزن', 'storemovementController.php', '-1.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '421';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 421, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('421', '1', '1', '0', '5604', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-1.00', '0', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '681', '9', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2232';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 6, 681, 0, 0
                    , 155.00, 9, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-02-24*155.00," WHERE transferproductid = 5605;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('681', '6', '9', '1', '5605', 'تحويل منتجات من المخزن', 'storemovementController.php', '11.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '160', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1965';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 681, 0, 0
                    , 155.00, 9, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('681', '1', '9', '0', '5605', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '151.00', '160', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '100', '7', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4017';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 6, 100, 0, 0
                    , 155.00, 6, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 100, 0, 0
                    , 155.00, -1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2022-07-21*155.00,1*2023-02-25*155.00," WHERE transferproductid = 5606;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '6', '7', '1', '5606', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-10', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '100';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 100, 0, 0
                    , 155.00, 6, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 100, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '7', '0', '5606', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-17.00', '-10', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '436', '1', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2222';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 436, 0, 0
                    , 160.00, -1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 160.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*160.00," WHERE transferproductid = 5607;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('436', '6', '1', '1', '5607', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '436';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 436, 0, 0
                    , 160.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('436', '1', '1', '0', '5607', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '2.00', '3', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '299', '2', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2223';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 299, 0, 0
                    , 155.00, -2, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2023-02-25*155.00," WHERE transferproductid = 5608;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('299', '6', '2', '1', '5608', 'تحويل منتجات من المخزن', 'storemovementController.php', '11.00', '9', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '38', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '299';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 299, 0, 0
                    , 155.00, 2, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('299', '1', '2', '0', '5608', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '36.00', '38', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '196', '2', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4092';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 6, 196, 0, 0
                    , 170.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 6, 196, 0, 0
                    , 170.00, -1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-04-11*170.00,1*2023-02-25*170.00," WHERE transferproductid = 5609;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('196', '6', '2', '1', '5609', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '196';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 196, 0, 0
                    , 170.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 196, 0, 0
                    , 170.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('196', '1', '2', '0', '5609', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '2', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '121', '1', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3053';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 6, 121, 0, 0
                    , 175.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-04-11*175.00," WHERE transferproductid = 5610;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('121', '6', '1', '1', '5610', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '6', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '121';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 121, 0, 0
                    , 175.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('121', '1', '1', '0', '5610', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '1', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('6', '1', '120', '1', '2023-02-25', '1', '0','1269',null,null,'2023-02-25 14:06:49',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3048';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 6, 120, 0, 0
                    , 175.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-04-11*175.00," WHERE transferproductid = 5611;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('120', '6', '1', '1', '5611', 'تحويل منتجات من المخزن', 'storemovementController.php', '4.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '120';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 120, 0, 0
                    , 175.00, 1, 0, 0, 1, '2023-02-25 14:06:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 14:06:49' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('120', '1', '1', '0', '5611', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '1', '1', '2023-02-25','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:36:50";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 14:06:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 14:06:50', '1', 'editshow', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 10:37:58";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 14:07:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 14:07:58', '1', '', '156.210.14.93', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:04:45";
UPDATE user SET loginip = "156.210.14.93", lastactivetime = "2023-02-25 14:34:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 14:34:45', '1', 'addsellBill', '156.210.14.93', '', 'DESKTOP');
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 < "2023-02-25 11:16:44";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 14:46:44", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 14:46:44', '4', '', '197.61.88.158', '', 'DESKTOP');
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 < "2023-02-25 11:16:44";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:16:47";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 14:46:47", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 14:46:47', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:16:57";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 14:46:57", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 14:46:57', '4', 'add', '197.61.88.158', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =15667
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(283,@clientdebt,@clientname);
UPDATE client SET  clientdebt = '11715' , clientdate = '2023-02-25 14:46:58', userid = '4' WHERE clientid = '283';
UPDATE client SET  inUse = 0 where clientid = 283;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('283','13715.00','2000','1','ايصال تحصيل (( قبض من عميل ))','15667', '11715', '2023-02-25 14:46:47', '4', 'clientPayedDeptController.php', '   ', '2000', '0', null, '0', null, null,'', '-1','1','1','1','1');
UPDATE save SET  savecurrentvalue = '3830',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('1830.00','2000', '0', '7', 'ايصال تحصيل (( قبض من عميل ))', '15667', '3830', '2023-02-25 14:46:58', '4',  'clientPayedDeptController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '2000', '2000', '2023-02-25', '4', '0', '0', '2023-02-25 14:46:58','اضافة ايصال سداد للعميل عزت وردة ','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6314', '141', '2000', '','0');
UPDATE accountstree SET name = 'خزينة محل العميد', customName = 'خزينة محل العميد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1093842', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '141';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6314', '363', '2000', '','0');
UPDATE accountstree SET name = 'عزت وردة ', customName = 'عزت وردة ', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '4', mydate = '2022-10-09', itemtype2 = '1', theValue = '-16670', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '363';
UPDATE clientdebtchange SET clientid = '283', clientdebtchangebefore = '13715.00', clientdebtchangeamount = '2000.00', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '15667', clientdebtchangeafter = '11715.00', clientdebtchangedate = '2023-02-25 14:46:47', userid = '4', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '2000.00',discount='', reciptid=null, dailyentryid = '6314',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1',saveConversionFactor='1' WHERE clientdebtchangeid = '15667';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:16:58";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 14:46:58", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 14:46:58', '4', 'editprint2', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:17:01";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 14:47:01", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 14:47:01', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:17:03";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 14:47:03", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 14:47:03', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:22:48";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:52:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 14:52:48', '1', '', '156.210.84.217', '', 'DESKTOP');
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 < "2023-02-25 11:22:49";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:23:12";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:53:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('buyBillController.php', '2023-02-25 14:53:12', '1', 'show', '156.210.84.217', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:23:27";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:53:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 14:53:27', '1', 'show', '156.210.84.217', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:23:46";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:53:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 14:53:46', '1', 'show', '156.210.84.217', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:24:03";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:54:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 14:54:03', '1', 'editsellBill', '156.210.84.217', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:24:16";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:54:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 14:54:16', '1', 'editsellBill', '156.210.84.217', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:24:39";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:54:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 14:54:39', '1', 'update', '156.210.84.217', '', 'DESKTOP');
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 10362;
UPDATE sellbill SET  sellbillsysdate = '2023-02-25 14:54:40', userid = '4',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '10362';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-15 where id = 1490;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 2608;
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 168.75, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 168.75
                where sellbilldetailid = 30218;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (387, '2023-02-25', 5075, 5075, 5075
                    , 4893.75, 5075, 4893.75, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0,29,0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5075, sellCostBuyPrice =sellCostBuyPrice-5075
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5075, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4893.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4893.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                        , netQuantity = netQuantity-29
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 5075, 5075, 5075
                    , 4893.75, 5075, 4893.75, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5075, sellCostBuyPrice =sellCostBuyPrice-5075
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5075, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4893.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4893.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0;
UPDATE storedetail SET  productquantity = '29', userid = '1', storedetaildate = '2023-02-25 14:54:40' WHERE storedetailid = '1296';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '7', '29', '0', '10362', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0.00', '29', '1', '2023-02-25 11:19:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-11 where id = 1488;
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 962.27, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 962.27
                where sellbilldetailid = 30219;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (386, '2023-02-25', 1925, 1925, 2035
                    , 10584.97, 2035, 10584.97, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0,11,0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1925, sellCostBuyPrice =sellCostBuyPrice-1925
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2035, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10584.97
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10584.97
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                        , netQuantity = netQuantity-11
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 1925, 1925, 2035
                    , 10584.97, 2035, 10584.97, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1925, sellCostBuyPrice =sellCostBuyPrice-1925
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2035, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10584.97
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10584.97
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0;
UPDATE storedetail SET  productquantity = '13', userid = '1', storedetaildate = '2023-02-25 14:54:40' WHERE storedetailid = '1295';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('386', '7', '11', '0', '10362', 'تعديل فاتورة مبيعات', 'sellbillController.php', '2.00', '13', '1', '2023-02-25 11:19:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 1482;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-3 where id = 2618;
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30220;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (383, '2023-02-25', 1750, 1500, 1850
                    , 1675, 1850, 1675, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1750, sellCostBuyPrice =sellCostBuyPrice-1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1850, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1675
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1675
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                        , netQuantity = netQuantity-10
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 1750, 1500, 1850
                    , 1675, 1850, 1675, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1750, sellCostBuyPrice =sellCostBuyPrice-1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1850, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1675
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1675
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0;
UPDATE storedetail SET  productquantity = '13', userid = '1', storedetaildate = '2023-02-25 14:54:40' WHERE storedetailid = '1292';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('383', '7', '10', '0', '10362', 'تعديل فاتورة مبيعات', 'sellbillController.php', '3.00', '13', '1', '2023-02-25 11:19:46','0','0');
CALL clientInUse(328,@clientdebt,@clientname);
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '328';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('328','8750.00','8750.00','1','تعديل فاتورة مبيعات','10362', '0', '2023-02-25 11:19:46', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '8750', '0', null, '0', null, null,'', '0','1','1','8750','1');
UPDATE client SET  inUse = 0 where clientid = 328;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 8750, 8500, 8960
                    , 17153.72, 8960, 17153.72, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8750, sellCostBuyPrice =sellCostBuyPrice-8500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-17153.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-17153.72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (328, '2023-02-25', 8750, 8500, 8960
                    , 17153.72, 8960, 17153.72, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8750, sellCostBuyPrice =sellCostBuyPrice-8500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-17153.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-8960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-17153.72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 8750, 8500, 8960
                    , 17153.72, 8960, 17153.72, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-8750, netSellCostBuyPrice = netSellCostBuyPrice-8500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-8960
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-17153.72
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-8960
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-17153.72
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-0;

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


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

DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
CALL clientInUse(328,@clientdebt,@clientname);
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) VALUES ('2023-02-25 11:19:46', '063f9d2b23f390', '328', '0.00', '2000', '0', '1', '5000', '5000', '3000', '2000', '1', '2023-02-25 11:19:46', '', '1', '0', 'ملاك كفر شكر مصر', '7', '1', '3', '0', 'ملاك كفر شكر مصر', '50', '10362', 'sellbillController', '0','','','','','-1','0','0','3000','0','0','0','0','0','0','0','0','0','0000-00-00');
UPDATE client SET  clientdebt = '2000', userid = '1' WHERE clientid = '328';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('328','0.00','2000','0','اضافة فاتورة مبيعات (معدله)','10367', '2000', '2023-02-25 14:54:40', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '5000', '0', null, '0', null, null,'', '0','1','1','1','1');
UPDATE client SET  inUse = 0 where clientid = 328;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('175','00387', '10367', '1', '387', '29.00', '100', '2900', '0', '', '0', '2023-02-25 14:54:40', '387', '0.00', '0', '1','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 175.00 , meanbuyprice = 168.75, lastbuyprice_withDiscount = 175.00, meanbuyprice_withDiscount = 168.75
                where sellbilldetailid = 30236;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (387, '2023-02-25', 2900, 5075, 5075
                    , 4893.75, 5075, 4893.75, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 29, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2900, sellCostBuyPrice =sellCostBuyPrice+5075
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5075, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4893.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4893.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+29
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 2900, 5075, 5075
                    , 4893.75, 5075, 4893.75, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2900, sellCostBuyPrice =sellCostBuyPrice+5075
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5075, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4893.75
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5075, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4893.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '-25', userid = '1', storedetaildate = '2023-02-25 14:54:40' WHERE storedetailid = '387';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('387', '1', '29', '1', '10367', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4.00', '-25', '1', '2023-02-25 14:54: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) VALUES ('175','00386', '10367', '1', '386', '11.00', '100', '1100', '0', '', '0', '2023-02-25 14:54:40', '386', '0.00', '0', '1','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 962.27, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 962.27
                where sellbilldetailid = 30237;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (386, '2023-02-25', 1100, 1925, 2035
                    , 10584.97, 2035, 10584.97, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 11, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1100, sellCostBuyPrice =sellCostBuyPrice+1925
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10584.97
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10584.97
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+11
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 1100, 1925, 2035
                    , 10584.97, 2035, 10584.97, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1100, sellCostBuyPrice =sellCostBuyPrice+1925
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10584.97
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10584.97
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '-13', userid = '1', storedetaildate = '2023-02-25 14:54:40' WHERE storedetailid = '386';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('386', '1', '11', '1', '10367', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '-2.00', '-13', '1', '2023-02-25 14:54: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) VALUES ('150','00383', '10367', '1', '383', '10.00', '100', '1000', '0', '', '0', '2023-02-25 14:54:41', '383', '0.00', '0', '1','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30238;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (383, '2023-02-25', 1000, 1500, 1850
                    , 1675, 1850, 1675, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1675
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1675
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 1000, 1500, 1850
                    , 1675, 1850, 1675, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1000, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1850, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1675
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1850, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1675
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '-16', userid = '1', storedetaildate = '2023-02-25 14:54:41' WHERE storedetailid = '383';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('383', '1', '10', '1', '10367', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '-6.00', '-16', '1', '2023-02-25 14:54:41','0','0');
UPDATE save SET  savecurrentvalue = '6830',  userid = '1' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('3830.00','3000', '0', '7', 'اضافة فاتورة مبيعات (معدله)', '10367', '6830', '2023-02-25 14:54:41', '1',  'sellbillController.php','328','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '5000', '5000', '2023-02-25', '1', '0', '0', '2023-02-25 14:54:41','تم اضافة فاتورة مبيعات ( اجل وكاش )','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6315', '407', '2000', '','0');
UPDATE accountstree SET name = 'ملاك كفر شكر مصر', customName = 'ملاك كفر شكر مصر', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '4', mydate = '2023-02-25', itemtype2 = '1', theValue = '2000', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '407';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6315', '141', '3000', '','0');
UPDATE accountstree SET name = 'خزينة محل العميد', customName = 'خزينة محل العميد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1090842', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '141';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6315', '16', '5000', '','0');
UPDATE accountstree SET name = 'المبيعات', customName = 'المبيعات', parent = '4', itemtype = '2', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '252823', theOrder = '0', layingOrder = '41',reportid = '2' WHERE id = '16';
UPDATE sellbill SET sellbilldate = '2023-02-25 11:19:46', sellbillserial = '063f9d2b23f390', sellbillclientid = '328', sellbilltotaldeptbefor = '0.00', sellbilltotaldeptafter = '2000.00', sellbilldiscount = '0', sellbilldiscounttype = '1', sellbilltotalbill = '5000.00', sellbillaftertotalbill = '5000.00', sellbilltotalpayed = '3000.00', sellbillfinalbill = '2000.00', sellbillstoreid = '1', sellbillsysdate = '2023-02-25 11:19:46',comment = '', userid = '1', conditions = '0', sellbillclientname = 'ملاك كفر شكر مصر', sellbillsaveid = '7', sellbildirectpayment = '1', billnameid = '3', sellerid = '0', tempclientName = 'ملاك كفر شكر مصر', sellQuantity = '50.00' , dailyentryid = '6315',obygyVisitId = '0',onlineOrderId = '0',delbyuserid = '1',delivery = '0',totalafterdelivery = '5000',billReservation='0',billReservationDate='0000-00-00',visaAccountId = '0',cashPayed = '3000',visaPayed = '0',isBankAccountTransfer = '0',extraDiscountPer='0',extraDiscountVal='0',taxOfDiscountPer='0',taxOfDiscountVal='0',taxBillNumber='0',collectionType = '0',collectionDate='0000-00-00' WHERE sellbillid = '10367';
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 5000, 8500, 8960
                    , 17153.72, 8960, 17153.72, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5000, sellCostBuyPrice =sellCostBuyPrice+8500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17153.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17153.72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (328, '2023-02-25', 5000, 8500, 8960
                    , 17153.72, 8960, 17153.72, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5000, sellCostBuyPrice =sellCostBuyPrice+8500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17153.72
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17153.72
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 5000, 8500, 8960
                    , 17153.72, 8960, 17153.72, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5000, netSellCostBuyPrice = netSellCostBuyPrice+8500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8960
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+17153.72
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8960
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+17153.72
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 10362 and newid=10367 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:24:43";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:54:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 14:54:43', '1', 'editprint', '156.210.84.217', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:25:12";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:55:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 14:55:12', '1', 'update', '156.210.84.217', '', 'DESKTOP');
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 10361;
UPDATE sellbill SET  sellbillsysdate = '2023-02-25 14:55:13', userid = '4',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '10361';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 1484;
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30215;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (384, '2023-02-25', 6125, 5250, 6475
                    , 5862.5, 6475, 5862.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0,35,0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6125, sellCostBuyPrice =sellCostBuyPrice-5250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6475, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5862.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5862.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                        , netQuantity = netQuantity-35
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 6125, 5250, 6475
                    , 5862.5, 6475, 5862.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6125, sellCostBuyPrice =sellCostBuyPrice-5250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6475, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5862.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5862.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0;
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2023-02-25 14:55:13' WHERE storedetailid = '1293';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('384', '7', '35', '0', '10361', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0.00', '35', '1', '2023-02-25 10:45:23','0','0');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 172.50, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 172.50
                where sellbilldetailid = 30216;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (382, '2023-02-25', 3325, 3325, 3610
                    , 3277.5, 3610, 3277.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0,19,0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3325, sellCostBuyPrice =sellCostBuyPrice-3325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3610, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3277.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3277.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                        , netQuantity = netQuantity-19
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 3325, 3325, 3610
                    , 3277.5, 3610, 3277.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3325, sellCostBuyPrice =sellCostBuyPrice-3325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3610, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3277.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3277.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0;
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2023-02-25 14:55:13' WHERE storedetailid = '1291';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('382', '7', '19', '0', '10361', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0.00', '19', '1', '2023-02-25 10:45:23','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-16 where id = 1486;
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30217;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (385, '2023-02-25', 2800, 2400, 2960
                    , 2680, 2960, 2680, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0,16,0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2800, sellCostBuyPrice =sellCostBuyPrice-2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                        , netQuantity = netQuantity-16
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (7, '2023-02-25', 2800, 2400, 2960
                    , 2680, 2960, 2680, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2800, sellCostBuyPrice =sellCostBuyPrice-2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2960, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0;
UPDATE storedetail SET  productquantity = '22', userid = '1', storedetaildate = '2023-02-25 14:55:13' WHERE storedetailid = '1294';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('385', '7', '16', '0', '10361', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6.00', '22', '1', '2023-02-25 10:45:23','0','0');
CALL clientInUse(327,@clientdebt,@clientname);
UPDATE client SET  clientdebt = '0', userid = '1' WHERE clientid = '327';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('327','12250.00','12250.00','1','تعديل فاتورة مبيعات','10361', '0', '2023-02-25 10:45:23', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '12250', '0', null, '0', null, null,'', '0','1','1','12250','1');
UPDATE client SET  inUse = 0 where clientid = 327;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 12250, 10975, 13045
                    , 11820, 13045, 11820, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-12250, sellCostBuyPrice =sellCostBuyPrice-10975
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-13045, sellCostMeanBuyPrice = sellCostMeanBuyPrice-11820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-13045, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-11820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (327, '2023-02-25', 12250, 10975, 13045
                    , 11820, 13045, 11820, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-12250, sellCostBuyPrice =sellCostBuyPrice-10975
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-13045, sellCostMeanBuyPrice = sellCostMeanBuyPrice-11820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-13045, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-11820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-0
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 12250, 10975, 13045
                    , 11820, 13045, 11820, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-12250, netSellCostBuyPrice = netSellCostBuyPrice-10975
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-13045
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-11820
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-13045
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-11820
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-0;

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


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

DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
CALL clientInUse(327,@clientdebt,@clientname);
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) VALUES ('2023-02-25 10:45:23', '063f9caa39aa84', '327', '0.00', '2000', '0', '1', '7000', '7000', '5000', '2000', '1', '2023-02-25 10:45:23', '', '1', '0', 'عمي مجدي كفر شكر مصر', '7', '1', '3', '0', 'عمي مجدي كفر شكر مصر', '70', '10361', 'sellbillController', '0','','','','','-1','0','0','5000','0','0','0','0','0','0','0','0','0','0000-00-00');
UPDATE client SET  clientdebt = '2000', userid = '1' WHERE clientid = '327';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('327','0.00','2000','0','اضافة فاتورة مبيعات (معدله)','10368', '2000', '2023-02-25 14:55:13', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '7000', '0', null, '0', null, null,'', '0','1','1','1','1');
UPDATE client SET  inUse = 0 where clientid = 327;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('150','00384', '10368', '1', '384', '35.00', '100', '3500', '0', '', '0', '2023-02-25 14:55:13', '384', '0.00', '0', '1','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30239;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (384, '2023-02-25', 3500, 5250, 6475
                    , 5862.5, 6475, 5862.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3500, sellCostBuyPrice =sellCostBuyPrice+5250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5862.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5862.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+35
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 3500, 5250, 6475
                    , 5862.5, 6475, 5862.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3500, sellCostBuyPrice =sellCostBuyPrice+5250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6475, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5862.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6475, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5862.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '-31', userid = '1', storedetaildate = '2023-02-25 14:55:13' WHERE storedetailid = '384';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('384', '1', '35', '1', '10368', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '4.00', '-31', '1', '2023-02-25 14:55: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) VALUES ('175','00382', '10368', '1', '382', '19.00', '100', '1900', '0', '', '0', '2023-02-25 14:55:13', '382', '0.00', '0', '1','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 172.50, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 172.50
                where sellbilldetailid = 30240;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (382, '2023-02-25', 1900, 3325, 3610
                    , 3277.5, 3610, 3277.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 19, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1900, sellCostBuyPrice =sellCostBuyPrice+3325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3277.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3277.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+19
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 1900, 3325, 3610
                    , 3277.5, 3610, 3277.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1900, sellCostBuyPrice =sellCostBuyPrice+3325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3277.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3610, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3277.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '-18', userid = '1', storedetaildate = '2023-02-25 14:55:13' WHERE storedetailid = '382';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('382', '1', '19', '1', '10368', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1.00', '-18', '1', '2023-02-25 14:55: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) VALUES ('150','00385', '10368', '1', '385', '16.00', '100', '1600', '0', '', '0', '2023-02-25 14:55:13', '385', '0.00', '0', '1','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30241;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (385, '2023-02-25', 1600, 2400, 2960
                    , 2680, 2960, 2680, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1600, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+16
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 1600, 2400, 2960
                    , 2680, 2960, 2680, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1600, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '-16', userid = '1', storedetaildate = '2023-02-25 14:55:14' WHERE storedetailid = '385';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('385', '1', '16', '1', '10368', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '0.00', '-16', '1', '2023-02-25 14:55:14','0','0');
UPDATE save SET  savecurrentvalue = '11830',  userid = '1' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('6830.00','5000', '0', '7', 'اضافة فاتورة مبيعات (معدله)', '10368', '11830', '2023-02-25 14:55:14', '1',  'sellbillController.php','327','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '7000', '7000', '2023-02-25', '1', '0', '0', '2023-02-25 14:55:14','تم اضافة فاتورة مبيعات ( اجل وكاش )','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6316', '406', '2000', '','0');
UPDATE accountstree SET name = 'عمي مجدي كفر شكر مصر', customName = 'عمي مجدي كفر شكر مصر', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '4', mydate = '2023-02-25', itemtype2 = '1', theValue = '2000', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '406';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6316', '141', '5000', '','0');
UPDATE accountstree SET name = 'خزينة محل العميد', customName = 'خزينة محل العميد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1085842', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '141';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6316', '16', '7000', '','0');
UPDATE accountstree SET name = 'المبيعات', customName = 'المبيعات', parent = '4', itemtype = '2', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '259823', theOrder = '0', layingOrder = '41',reportid = '2' WHERE id = '16';
UPDATE sellbill SET sellbilldate = '2023-02-25 10:45:23', sellbillserial = '063f9caa39aa84', sellbillclientid = '327', sellbilltotaldeptbefor = '0.00', sellbilltotaldeptafter = '2000.00', sellbilldiscount = '0', sellbilldiscounttype = '1', sellbilltotalbill = '7000.00', sellbillaftertotalbill = '7000.00', sellbilltotalpayed = '5000.00', sellbillfinalbill = '2000.00', sellbillstoreid = '1', sellbillsysdate = '2023-02-25 10:45:23',comment = '', userid = '1', conditions = '0', sellbillclientname = 'عمي مجدي كفر شكر مصر', sellbillsaveid = '7', sellbildirectpayment = '1', billnameid = '3', sellerid = '0', tempclientName = 'عمي مجدي كفر شكر مصر', sellQuantity = '70.00' , dailyentryid = '6316',obygyVisitId = '0',onlineOrderId = '0',delbyuserid = '1',delivery = '0',totalafterdelivery = '7000',billReservation='0',billReservationDate='0000-00-00',visaAccountId = '0',cashPayed = '5000',visaPayed = '0',isBankAccountTransfer = '0',extraDiscountPer='0',extraDiscountVal='0',taxOfDiscountPer='0',taxOfDiscountVal='0',taxBillNumber='0',collectionType = '0',collectionDate='0000-00-00' WHERE sellbillid = '10368';
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 7000, 10975, 13045
                    , 11820, 13045, 11820, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7000, sellCostBuyPrice =sellCostBuyPrice+10975
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13045, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13045, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (327, '2023-02-25', 7000, 10975, 13045
                    , 11820, 13045, 11820, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7000, sellCostBuyPrice =sellCostBuyPrice+10975
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13045, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13045, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11820
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 7000, 10975, 13045
                    , 11820, 13045, 11820, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7000, netSellCostBuyPrice = netSellCostBuyPrice+10975
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+13045
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+11820
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+13045
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+11820
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 10361 and newid=10368 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:25:16";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:55:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 14:55:16', '1', 'editprint', '156.210.84.217', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:25:41";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:55:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 14:55:41', '1', '', '156.210.84.217', '', 'DESKTOP');
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 < "2023-02-25 11:25:41";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:25:47";
UPDATE user SET loginip = "156.210.84.217", lastactivetime = "2023-02-25 14:55:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 14:55:47', '1', '', '156.210.84.217', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 11:40:07";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 15:10:07", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 15:10:07', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 12:14:41";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 15:44:41", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 15:44:41', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 12:14:52";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 15:44:52", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 15:44:52', '4', 'addsellBill', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 3;
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 < "2023-02-25 13:08:01";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:38:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 16:38:01', '1', '', '156.210.24.13', '', 'DESKTOP');
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 < "2023-02-25 13:08:01";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:10:21";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:40:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 16:40:21', '1', '', '156.210.24.13', '', 'DESKTOP');
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 < "2023-02-25 13:11:24";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 16:41:24", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 16:41:24', '4', '', '197.61.88.158', '', 'DESKTOP');
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 < "2023-02-25 13:11:24";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:11:27";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 16:41:27", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:41:27', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:11:36";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 16:41:36", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:41:36', '4', 'add', '197.61.88.158', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =15672
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(129,@clientdebt,@clientname);
UPDATE client SET  clientdebt = '4250' , clientdate = '2023-02-25 16:41:36', userid = '4' WHERE clientid = '129';
UPDATE client SET  inUse = 0 where clientid = 129;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('129','4900.00','650','1','ايصال تحصيل (( قبض من عميل ))','15672', '4250', '2023-02-25 16:41:27', '4', 'clientPayedDeptController.php', '   ', '650', '0', null, '0', null, null,'', '-1','1','1','1','1');
UPDATE save SET  savecurrentvalue = '12480',  userid = '4' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('11830.00','650', '0', '7', 'ايصال تحصيل (( قبض من عميل ))', '15672', '12480', '2023-02-25 16:41:36', '4',  'clientPayedDeptController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '650', '650', '2023-02-25', '4', '0', '0', '2023-02-25 16:41:36','اضافة ايصال سداد للعميل احمد غنيم','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6317', '141', '650', '','0');
UPDATE accountstree SET name = 'خزينة محل العميد', customName = 'خزينة محل العميد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1085192', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '141';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6317', '205', '650', '','0');
UPDATE accountstree SET name = 'احمد غنيم', customName = 'احمد غنيم', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '4', mydate = '2022-03-10', itemtype2 = '1', theValue = '-62475', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '205';
UPDATE clientdebtchange SET clientid = '129', clientdebtchangebefore = '4900.00', clientdebtchangeamount = '650.00', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '15672', clientdebtchangeafter = '4250.00', clientdebtchangedate = '2023-02-25 16:41:27', userid = '4', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '650.00',discount='', reciptid=null, dailyentryid = '6317',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1',saveConversionFactor='1' WHERE clientdebtchangeid = '15672';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:11:37";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 16:41:37", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:41:37', '4', 'editprint2', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:11:43";
UPDATE user SET loginip = "197.61.88.158", lastactivetime = "2023-02-25 16:41:43", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 16:41:43', '4', '', '197.61.88.158', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:11:45";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:41:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 16:41:45', '1', '', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:12:15";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:42:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 16:42:15', '1', 'add', '156.210.24.13', '', 'DESKTOP');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment) VALUES ('7','9', '12480', '2023-02-25', '1', '0', '0','');
UPDATE save SET  savecurrentvalue = '0',  userid = '1' WHERE saveid = '7';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('12480.00','12480', '1', '7', 'تحويل امول الى الخزنة  [ الشيخ وليد ] ', '454', '0', '2023-02-25 16:42:15', '1',  'transfermoneyController.php','0','');
UPDATE save SET  savecurrentvalue = '5331770',  userid = '1' WHERE saveid = '9';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('5319290.00','12480', '0', '9', 'تحويل امول من الخزنة  [ خزينة محل العميد ] ', '454', '5331770', '2023-02-25 16:42:15', '1',  'transfermoneyController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '12480', '12480', '2023-02-25', '1', '0', '0', '2023-02-25 16:42:15','اضافة تحويل من خزينة محل العميد الى الشيخ وليد','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6318', '156', '12480', '','0');
UPDATE accountstree SET name = 'الشيخ وليد', customName = 'الشيخ وليد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-09', itemtype2 = '1', theValue = '5331770', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '156';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6318', '141', '12480', '','0');
UPDATE accountstree SET name = 'خزينة محل العميد', customName = 'خزينة محل العميد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1097672', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '141';
UPDATE transfermoney SET saveidfrom = '7', saveidto = '9', transfermoneyvalue = '12480.00', transfermoneydate = '2023-02-25', userid = '1', conditions = '0' , dailyentryid = '6318' , comment = '' WHERE transfermoneyid = '454';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:12:20";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:42:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 16:42:20', '1', 'sucess', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:12:22";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:42:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 16:42:22', '1', 'show', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:13:42";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:43:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2023-02-25 16:43:42', '1', 'all', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:14:06";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:44:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2023-02-25 16:44:06', '1', 'all', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:16:47";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:46:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:46:47', '1', '', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:17:46";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:47:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:47:46', '1', 'add', '156.210.24.13', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =15673
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(13,@clientdebt,@clientname);
UPDATE client SET  clientdebt = '2000' , clientdate = '2023-02-25 16:47:46', userid = '1' WHERE clientid = '13';
UPDATE client SET  inUse = 0 where clientid = 13;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('13','6115.00','4115','1','ايصال تحصيل (( قبض من عميل ))','15673', '2000', '2023-02-25 16:46:47', '1', 'clientPayedDeptController.php', '   خصم عميل', '4115', '0', null, '0', null, null,'', '-1','1','1','1','1');
UPDATE save SET  savecurrentvalue = '7115',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('3000.00','4115', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '15673', '7115', '2023-02-25 16:47:46', '1',  'clientPayedDeptController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '4115', '4115', '2023-02-25', '1', '0', '0', '2023-02-25 16:47:46','اضافة ايصال سداد للعميل سنتر المجد','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6319', '54', '4115', '','0');
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2018-04-21', itemtype2 = '1', theValue = '-134581', theOrder = '0', layingOrder = '1221',reportid = '2' WHERE id = '54';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6319', '66', '4115', '','0');
UPDATE accountstree SET name = 'سنتر المجد', customName = 'سنتر المجد', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-65855', theOrder = '0', layingOrder = '',reportid = '0' WHERE id = '66';
UPDATE clientdebtchange SET clientid = '13', clientdebtchangebefore = '6115.00', clientdebtchangeamount = '4115.00', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '15673', clientdebtchangeafter = '2000.00', clientdebtchangedate = '2023-02-25 16:46:47', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   خصم عميل', totalOperationCost = '4115.00',discount='', reciptid=null, dailyentryid = '6319',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1',saveConversionFactor='1' WHERE clientdebtchangeid = '15673';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:17:47";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:47:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:47:47', '1', 'sucess', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:17:48";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:47:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:47:48', '1', 'show', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:18:17";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:48:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:48:17', '1', '', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:18:44";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:48:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:48:44', '1', 'add', '156.210.24.13', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =15674
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(129,@clientdebt,@clientname);
UPDATE client SET  clientdebt = '3900' , clientdate = '2023-02-25 16:48:44', userid = '1' WHERE clientid = '129';
UPDATE client SET  inUse = 0 where clientid = 129;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('129','4250.00','350','1','ايصال تحصيل (( قبض من عميل ))','15674', '3900', '2023-02-25 16:48:17', '1', 'clientPayedDeptController.php', '   ', '350', '0', null, '0', null, null,'', '-1','1','1','1','1');
UPDATE save SET  savecurrentvalue = '7465',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('7115.00','350', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '15674', '7465', '2023-02-25 16:48:45', '1',  'clientPayedDeptController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '350', '350', '2023-02-25', '1', '0', '0', '2023-02-25 16:48:45','اضافة ايصال سداد للعميل احمد غنيم','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6320', '54', '350', '','0');
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2018-04-21', itemtype2 = '1', theValue = '-134231', theOrder = '0', layingOrder = '1221',reportid = '2' WHERE id = '54';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6320', '205', '350', '','0');
UPDATE accountstree SET name = 'احمد غنيم', customName = 'احمد غنيم', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '4', mydate = '2022-03-10', itemtype2 = '1', theValue = '-62825', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '205';
UPDATE clientdebtchange SET clientid = '129', clientdebtchangebefore = '4250.00', clientdebtchangeamount = '350.00', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '15674', clientdebtchangeafter = '3900.00', clientdebtchangedate = '2023-02-25 16:48:17', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '350.00',discount='', reciptid=null, dailyentryid = '6320',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1',saveConversionFactor='1' WHERE clientdebtchangeid = '15674';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:18:45";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:48:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:48:45', '1', 'sucess', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:18:47";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:48:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 16:48:47', '1', 'show', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:18:54";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:48:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 16:48:54', '1', '', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:19:04";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:49:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 16:49:04', '1', 'add', '156.210.24.13', '', 'DESKTOP');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment) VALUES ('1','9', '7465.00', '2023-02-25', '1', '0', '0','');
UPDATE save SET  savecurrentvalue = '0',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('7465.00','7465.00', '1', '1', 'تحويل امول الى الخزنة  [ الشيخ وليد ] ', '455', '0', '2023-02-25 16:49:04', '1',  'transfermoneyController.php','0','');
UPDATE save SET  savecurrentvalue = '5339235',  userid = '1' WHERE saveid = '9';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('5331770.00','7465.00', '0', '9', 'تحويل امول من الخزنة  [ الخزنة الرئيسية ] ', '455', '5339235', '2023-02-25 16:49:04', '1',  'transfermoneyController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '7465', '7465', '2023-02-25', '1', '0', '0', '2023-02-25 16:49:04','اضافة تحويل من الخزنة الرئيسية الى الشيخ وليد','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6321', '156', '7465.00', '','0');
UPDATE accountstree SET name = 'الشيخ وليد', customName = 'الشيخ وليد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-09', itemtype2 = '1', theValue = '5339235', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '156';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6321', '54', '7465.00', '','0');
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2018-04-21', itemtype2 = '1', theValue = '-141696', theOrder = '0', layingOrder = '1221',reportid = '2' WHERE id = '54';
UPDATE transfermoney SET saveidfrom = '1', saveidto = '9', transfermoneyvalue = '7465.00', transfermoneydate = '2023-02-25', userid = '1', conditions = '0' , dailyentryid = '6321' , comment = '' WHERE transfermoneyid = '455';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:19:05";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:49:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 16:49:05', '1', 'sucess', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:19:07";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:49:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 16:49:07', '1', 'show', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:19:21";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:49:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 16:49:21', '1', 'addsellBill', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:19:57";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:49:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 16:49:57', '1', '', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:20:03";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 16:50:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 16:50:03', '1', '', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:48:27";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 17:18:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 17:18:28', '1', 'add', '156.210.24.13', '', 'DESKTOP');
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 deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,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,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment ,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            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;
;;

;
BEGIN;
CALL insertUniqueOptNum(1270,5,1,108,25,'2023-02-25',1,0, '' ,0,0,0,0,0,'2023-02-25 17:18:28',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1652';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 5, 108, 0, 0
                    , 160.00, 24, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 108, 0, 0
                    , 160.00, -1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 160.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "24*2022-04-15*160.00,1*2023-02-25*160.00," WHERE transferproductid = 5612;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('108', '5', '25', '1', '5612', 'تحويل منتجات من المخزن', 'storemovementController.php', '24.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '114', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '108';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 108, 0, 0
                    , 160.00, 24, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 108, 0, 0
                    , 160.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('108', '1', '25', '0', '5612', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '89.00', '114', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '303', '19', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '849';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 303, 0, 0
                    , 165.00, 9, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-29', 5, 303, 0, 0
                    , 165.00, 10, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2021-11-08*165.00,10*2022-03-29*165.00," WHERE transferproductid = 5613;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('303', '5', '19', '1', '5613', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '303';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 303, 0, 0
                    , 165.00, 9, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-29', 1, 303, 0, 0
                    , 165.00, 10, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('303', '1', '19', '0', '5613', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '19', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '12', '17', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3040';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 5, 12, 0, 0
                    , 145.00, 17, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-17, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "17*2022-04-15*145.00," WHERE transferproductid = 5614;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '5', '17', '1', '5614', 'تحويل منتجات من المخزن', 'storemovementController.php', '20.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '168', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '12';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 12, 0, 0
                    , 145.00, 17, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+17, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '1', '17', '0', '5614', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '151.00', '168', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '258', '22', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4044';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 5, 258, 0, 0
                    , 190.00, 22, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-22, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "22*2022-07-21*190.00," WHERE transferproductid = 5615;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('258', '5', '22', '1', '5615', 'تحويل منتجات من المخزن', 'storemovementController.php', '24.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-38', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '258';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 258, 0, 0
                    , 190.00, 22, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+22, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('258', '1', '22', '0', '5615', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-60.00', '-38', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '485', '9', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '845';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 485, 0, 0
                    , 150.00, -9, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 150.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2023-02-25*150.00," WHERE transferproductid = 5616;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('485', '5', '9', '1', '5616', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '485';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 485, 0, 0
                    , 150.00, 9, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('485', '1', '9', '0', '5616', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '9', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '532', '5', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '817';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 532, 0, 0
                    , 195.00, 5, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2021-11-08*195.00," WHERE transferproductid = 5617;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('532', '5', '5', '1', '5617', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '145', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '532';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 532, 0, 0
                    , 195.00, 5, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('532', '1', '5', '0', '5617', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '140.00', '145', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '481', '3', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '829';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 481, 0, 0
                    , 165.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 481, 0, 0
                    , 165.00, -1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 165.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2021-11-08*165.00,1*2023-02-25*165.00," WHERE transferproductid = 5618;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('481', '5', '3', '1', '5618', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '481';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 481, 0, 0
                    , 165.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 481, 0, 0
                    , 165.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('481', '1', '3', '0', '5618', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '3', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '163', '9', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '843';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 163, 0, 0
                    , 165.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 163, 0, 0
                    , 165.00, -7, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 165.00,
                        buyQuantity =buyQuantity+-7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2021-11-08*165.00,7*2023-02-25*165.00," WHERE transferproductid = 5619;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('163', '5', '9', '1', '5619', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '163';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 163, 0, 0
                    , 165.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 163, 0, 0
                    , 165.00, 7, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('163', '1', '9', '0', '5619', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '9', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '497', '9', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '815';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 497, 0, 0
                    , 165.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 497, 0, 0
                    , 165.00, -3, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 165.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2021-11-08*165.00,3*2023-02-25*165.00," WHERE transferproductid = 5620;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('497', '5', '9', '1', '5620', 'تحويل منتجات من المخزن', 'storemovementController.php', '6.00', '-3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '23', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '497';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 497, 0, 0
                    , 165.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 497, 0, 0
                    , 165.00, 3, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('497', '1', '9', '0', '5620', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '14.00', '23', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '498', '6', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '846';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 498, 0, 0
                    , 170.00, 5, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 498, 0, 0
                    , 170.00, -1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2021-11-08*170.00,1*2023-02-25*170.00," WHERE transferproductid = 5621;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('498', '5', '6', '1', '5621', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '498';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 498, 0, 0
                    , 170.00, 5, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 498, 0, 0
                    , 170.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('498', '1', '6', '0', '5621', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '13.00', '19', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '24', '14', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3038';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 5, 24, 0, 0
                    , 170.00, 7, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-7, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 24, 0, 0
                    , 170.00, -7, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2022-04-15*170.00,7*2023-02-25*170.00," WHERE transferproductid = 5622;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('24', '5', '14', '1', '5622', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '-6', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '68', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '24';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 24, 0, 0
                    , 170.00, 7, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 24, 0, 0
                    , 170.00, 7, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('24', '1', '14', '0', '5622', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '54.00', '68', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '636', '13', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3472';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-28', 5, 636, 0, 0
                    , 175.00, 10, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 636, 0, 0
                    , 175.00, -3, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 175.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2022-04-28*175.00,3*2023-02-25*175.00," WHERE transferproductid = 5623;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('636', '5', '13', '1', '5623', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1914';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-28', 1, 636, 0, 0
                    , 175.00, 10, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 636, 0, 0
                    , 175.00, 3, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('636', '1', '13', '0', '5623', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '15.00', '28', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '1062', '29', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3765';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-10', 5, 1062, 0, 0
                    , 265.00, 18, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-18, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 1062, 0, 0
                    , 265.00, -11, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 265.00,
                        buyQuantity =buyQuantity+-11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2022-06-10*265.00,11*2023-02-25*265.00," WHERE transferproductid = 5624;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1062', '5', '29', '1', '5624', 'تحويل منتجات من المخزن', 'storemovementController.php', '28.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-165', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3723';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-10', 1, 1062, 0, 0
                    , 265.00, 18, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1062, 0, 0
                    , 265.00, 11, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1062', '1', '29', '0', '5624', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-194.00', '-165', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '635', '15', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2283';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 5, 635, 0, 0
                    , 210.00, 11, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-11, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 635, 0, 0
                    , 210.00, -4, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "11*2022-02-24*210.00,4*2023-02-25*210.00," WHERE transferproductid = 5625;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('635', '5', '15', '1', '5625', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '214', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1912';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 635, 0, 0
                    , 210.00, 11, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 635, 0, 0
                    , 210.00, 4, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('635', '1', '15', '0', '5625', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '199.00', '214', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '1119', '14', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-13', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4048';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 1119, 0, 0
                    , 210.00, -14, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "14*2023-02-25*210.00," WHERE transferproductid = 5626;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1119', '5', '14', '1', '5626', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '-13', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '55', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4009';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1119, 0, 0
                    , 210.00, 14, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1119', '1', '14', '0', '5626', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '41.00', '55', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '486', '6', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '859';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 486, 0, 0
                    , 165.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2021-11-08*165.00," WHERE transferproductid = 5627;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('486', '5', '6', '1', '5627', 'تحويل منتجات من المخزن', 'storemovementController.php', '6.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '486';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 486, 0, 0
                    , 165.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('486', '1', '6', '0', '5627', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '19.00', '25', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '20', '4', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4087';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 5, 20, 0, 0
                    , 175.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 20, 0, 0
                    , 175.00, -3, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 175.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2021-12-07*175.00,3*2023-02-25*175.00," WHERE transferproductid = 5628;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('20', '5', '4', '1', '5628', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '-3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '20';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 20, 0, 0
                    , 175.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 20, 0, 0
                    , 175.00, 3, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('20', '1', '4', '0', '5628', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '24.00', '28', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '489', '3', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '834';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 489, 0, 0
                    , 170.00, 3, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2021-11-08*170.00," WHERE transferproductid = 5629;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('489', '5', '3', '1', '5629', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '4', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '489';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 489, 0, 0
                    , 170.00, 3, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('489', '1', '3', '0', '5629', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '3', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '529', '6', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '836';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 529, 0, 0
                    , 195.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2021-11-08*195.00," WHERE transferproductid = 5630;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('529', '5', '6', '1', '5630', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '-3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '529';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 529, 0, 0
                    , 195.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('529', '1', '6', '0', '5630', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '6', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '852', '1', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2740';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 852, 0, 0
                    , 195.00, -1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*195.00," WHERE transferproductid = 5631;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('852', '5', '1', '1', '5631', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2702';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 852, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('852', '1', '1', '0', '5631', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '5.00', '6', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '747', '1', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2284';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-29', 5, 747, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-03-29*195.00," WHERE transferproductid = 5632;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('747', '5', '1', '1', '5632', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '26', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2166';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-29', 1, 747, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('747', '1', '1', '0', '5632', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '25.00', '26', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '853', '1', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2739';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-29', 5, 853, 0, 0
                    , 220.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-03-29*220.00," WHERE transferproductid = 5633;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('853', '5', '1', '1', '5633', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '141', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2703';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-29', 1, 853, 0, 0
                    , 220.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('853', '1', '1', '0', '5633', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '140.00', '141', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '535', '1', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '854';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 535, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2021-11-08*195.00," WHERE transferproductid = 5634;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('535', '5', '1', '1', '5634', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '535';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 535, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('535', '1', '1', '0', '5634', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '24.00', '25', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '501', '3', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4231';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 5, 501, 0, 0
                    , 165.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 501, 0, 0
                    , 165.00, -2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 165.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-04-11*165.00,2*2023-02-25*165.00," WHERE transferproductid = 5635;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('501', '5', '3', '1', '5635', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '501';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 501, 0, 0
                    , 165.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 501, 0, 0
                    , 165.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('501', '1', '3', '0', '5635', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '3', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '1', '23', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3039';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 5, 1, 0, 0
                    , 150.00, 23, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-23, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "23*2022-04-15*150.00," WHERE transferproductid = 5636;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '5', '23', '1', '5636', 'تحويل منتجات من المخزن', 'storemovementController.php', '23.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '133', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 1, 0, 0
                    , 150.00, 23, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+23, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '23', '0', '5636', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '110.00', '133', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '1078', '1', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3918';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 1078, 0, 0
                    , 220.00, -1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 220.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*220.00," WHERE transferproductid = 5637;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1078', '5', '1', '1', '5637', 'تحويل منتجات من المخزن', 'storemovementController.php', '6.00', '5', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '27', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3819';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1078, 0, 0
                    , 220.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1078', '1', '1', '0', '5637', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '26.00', '27', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '1125', '1', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4121';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-09', 5, 1125, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-09*210.00," WHERE transferproductid = 5638;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1125', '5', '1', '1', '5638', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '59', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4096';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-09', 1, 1125, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1125', '1', '1', '0', '5638', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '58.00', '59', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '440', '1', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '862';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 5, 440, 0, 0
                    , 170.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-04-15*170.00," WHERE transferproductid = 5639;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('440', '5', '1', '1', '5639', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '440';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 440, 0, 0
                    , 170.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('440', '1', '1', '0', '5639', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '1', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '1049', '17', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3790';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-05-30', 5, 1049, 0, 0
                    , 150.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-26', 5, 1049, 0, 0
                    , 150.00, 13, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-12-03', 5, 1049, 0, 0
                    , 150.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 1049, 0, 0
                    , 150.00, -1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 150.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2022-05-30*150.00,13*2022-06-26*150.00,1*2022-12-03*150.00,1*2023-02-25*150.00," WHERE transferproductid = 5640;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1049', '5', '17', '1', '5640', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '17', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3653';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-05-30', 1, 1049, 0, 0
                    , 150.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-26', 1, 1049, 0, 0
                    , 150.00, 13, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-12-03', 1, 1049, 0, 0
                    , 150.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1049, 0, 0
                    , 150.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1049', '1', '17', '0', '5640', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '17', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '181', '14', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2258';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 5, 181, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 181, 0, 0
                    , 195.00, -12, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2022-02-24*195.00,12*2023-02-25*195.00," WHERE transferproductid = 5641;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('181', '5', '14', '1', '5641', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '93', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '181';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 181, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 181, 0, 0
                    , 195.00, 12, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('181', '1', '14', '0', '5641', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '79.00', '93', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '801', '8', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2594';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 5, 801, 0, 0
                    , 190.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 801, 0, 0
                    , 190.00, -7, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 190.00,
                        buyQuantity =buyQuantity+-7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-03-16*190.00,7*2023-02-25*190.00," WHERE transferproductid = 5642;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('801', '5', '8', '1', '5642', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '-5', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '23', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2407';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 801, 0, 0
                    , 190.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 801, 0, 0
                    , 190.00, 7, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('801', '1', '8', '0', '5642', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '15.00', '23', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '525', '12', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2590';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 5, 525, 0, 0
                    , 195.00, 10, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 525, 0, 0
                    , 195.00, -2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2022-03-16*195.00,2*2023-02-25*195.00," WHERE transferproductid = 5643;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('525', '5', '12', '1', '5643', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '525';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 525, 0, 0
                    , 195.00, 10, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 525, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('525', '1', '12', '0', '5643', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '12.00', '24', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '528', '3', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '830';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 528, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 528, 0, 0
                    , 195.00, -2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2021-11-08*195.00,2*2023-02-25*195.00," WHERE transferproductid = 5644;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('528', '5', '3', '1', '5644', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '528';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 528, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 528, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('528', '1', '3', '0', '5644', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '22.00', '25', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '537', '6', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '856';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 537, 0, 0
                    , 195.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2021-11-08*195.00," WHERE transferproductid = 5645;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('537', '5', '6', '1', '5645', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '-3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '67', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '537';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 537, 0, 0
                    , 195.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('537', '1', '6', '0', '5645', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '61.00', '67', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '18', '27', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-27', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3208';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 18, 0, 0
                    , 185.00, -27, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 185.00,
                        buyQuantity =buyQuantity+-27, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "27*2023-02-25*185.00," WHERE transferproductid = 5646;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('18', '5', '27', '1', '5646', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-27', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '221', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '18';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 18, 0, 0
                    , 185.00, 27, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+27, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('18', '1', '27', '0', '5646', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '194.00', '221', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '22', '21', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2282';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 5, 22, 0, 0
                    , 175.00, 21, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-21, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "21*2022-02-24*175.00," WHERE transferproductid = 5647;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('22', '5', '21', '1', '5647', 'تحويل منتجات من المخزن', 'storemovementController.php', '21.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '22';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 22, 0, 0
                    , 175.00, 21, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('22', '1', '21', '0', '5647', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '19.00', '40', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '100', '23', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '29', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1656';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 5, 100, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 5, 100, 0, 0
                    , 155.00, 22, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-22, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2021-12-07*155.00,22*2022-03-16*155.00," WHERE transferproductid = 5648;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '5', '23', '1', '5648', 'تحويل منتجات من المخزن', 'storemovementController.php', '52.00', '29', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '13', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '100';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 100, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 100, 0, 0
                    , 155.00, 22, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+22, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '23', '0', '5648', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-10.00', '13', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '185', '29', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3036';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 5, 185, 0, 0
                    , 180.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-09', 5, 185, 0, 0
                    , 180.00, 23, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-23, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2022-04-15*180.00,23*2022-08-09*180.00," WHERE transferproductid = 5649;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('185', '5', '29', '1', '5649', 'تحويل منتجات من المخزن', 'storemovementController.php', '29.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '61', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '185';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 185, 0, 0
                    , 180.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-09', 1, 185, 0, 0
                    , 180.00, 23, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+23, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('185', '1', '29', '0', '5649', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '32.00', '61', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '492', '13', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '876';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 5, 492, 0, 0
                    , 180.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-20', 5, 492, 0, 0
                    , 180.00, 7, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-7, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2022-07-19*180.00,7*2022-08-20*180.00," WHERE transferproductid = 5650;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('492', '5', '13', '1', '5650', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '125', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '492';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-19', 1, 492, 0, 0
                    , 180.00, 6, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-20', 1, 492, 0, 0
                    , 180.00, 7, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('492', '1', '13', '0', '5650', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '112.00', '125', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '258', '11', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4044';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 5, 258, 0, 0
                    , 190.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 258, 0, 0
                    , 190.00, -9, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 190.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2022-07-21*190.00,9*2023-02-25*190.00," WHERE transferproductid = 5651;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('258', '5', '11', '1', '5651', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '-9', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-27', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '258';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 258, 0, 0
                    , 190.00, 2, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 258, 0, 0
                    , 190.00, 9, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('258', '1', '11', '0', '5651', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-38.00', '-27', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '23', '8', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3037';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 5, 23, 0, 0
                    , 185.00, 8, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2022-04-15*185.00," WHERE transferproductid = 5652;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('23', '5', '8', '1', '5652', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '23';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 23, 0, 0
                    , 185.00, 8, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('23', '1', '8', '0', '5652', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '40.00', '48', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '1078', '9', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:28',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3918';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 1078, 0, 0
                    , 220.00, -9, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyprice = 220.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2023-02-25*220.00," WHERE transferproductid = 5653;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1078', '5', '9', '1', '5653', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '-4', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3819';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1078, 0, 0
                    , 220.00, 9, 0, 0, 1, '2023-02-25 17:18:28')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:28' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1078', '1', '9', '0', '5653', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '27.00', '36', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '123', '17', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2280';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 5, 123, 0, 0
                    , 200.00, 12, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 123, 0, 0
                    , 200.00, -5, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 200.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2022-02-24*200.00,5*2023-02-25*200.00," WHERE transferproductid = 5654;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('123', '5', '17', '1', '5654', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '-4', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '238', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '123';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 123, 0, 0
                    , 200.00, 12, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 123, 0, 0
                    , 200.00, 5, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('123', '1', '17', '0', '5654', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '221.00', '238', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '1123', '13', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4120';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-20', 5, 1123, 0, 0
                    , 200.00, 7, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-7, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 1123, 0, 0
                    , 200.00, -6, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 200.00,
                        buyQuantity =buyQuantity+-6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2022-08-20*200.00,6*2023-02-25*200.00," WHERE transferproductid = 5655;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1123', '5', '13', '1', '5655', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '213', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4094';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-20', 1, 1123, 0, 0
                    , 200.00, 7, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1123, 0, 0
                    , 200.00, 6, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1123', '1', '13', '0', '5655', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '200.00', '213', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '482', '8', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '873';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 482, 0, 0
                    , 180.00, 8, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2021-11-08*180.00," WHERE transferproductid = 5656;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('482', '5', '8', '1', '5656', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '482';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 482, 0, 0
                    , 180.00, 8, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('482', '1', '8', '0', '5656', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '8', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '525', '7', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2590';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 525, 0, 0
                    , 195.00, -7, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2023-02-25*195.00," WHERE transferproductid = 5657;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('525', '5', '7', '1', '5657', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '-6', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '31', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '525';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 525, 0, 0
                    , 195.00, 7, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('525', '1', '7', '0', '5657', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '24.00', '31', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '13', '3', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4088';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 5, 13, 0, 0
                    , 175.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 13, 0, 0
                    , 175.00, -2, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 175.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-04-11*175.00,2*2023-02-25*175.00," WHERE transferproductid = 5658;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13', '5', '3', '1', '5658', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '13';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 13, 0, 0
                    , 175.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 13, 0, 0
                    , 175.00, 2, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13', '1', '3', '0', '5658', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '2.00', '5', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '479', '4', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '893';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 479, 0, 0
                    , 165.00, -4, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 165.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2023-02-25*165.00," WHERE transferproductid = 5659;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('479', '5', '4', '1', '5659', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '479';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 479, 0, 0
                    , 165.00, 4, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('479', '1', '4', '0', '5659', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '4', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '12', '9', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3040';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 5, 12, 0, 0
                    , 145.00, 3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 12, 0, 0
                    , 145.00, -6, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2022-04-15*145.00,6*2023-02-25*145.00," WHERE transferproductid = 5660;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '5', '9', '1', '5660', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '-6', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '177', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '12';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 12, 0, 0
                    , 145.00, 3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 12, 0, 0
                    , 145.00, 6, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '1', '9', '0', '5660', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '168.00', '177', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '200', '4', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '847';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-10-16', 5, 200, 0, 0
                    , 180.00, 3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 200, 0, 0
                    , 180.00, -1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2022-10-16*180.00,1*2023-02-25*180.00," WHERE transferproductid = 5661;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('200', '5', '4', '1', '5661', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '200';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-10-16', 1, 200, 0, 0
                    , 180.00, 3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 200, 0, 0
                    , 180.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('200', '1', '4', '0', '5661', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '4', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '748', '5', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2285';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 748, 0, 0
                    , 185.00, -5, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 185.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2023-02-25*185.00," WHERE transferproductid = 5662;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('748', '5', '5', '1', '5662', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '13', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2167';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 748, 0, 0
                    , 185.00, 5, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('748', '1', '5', '0', '5662', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '8.00', '13', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '1114', '13', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4036';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 5, 1114, 0, 0
                    , 210.00, 9, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 1114, 0, 0
                    , 210.00, -4, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2022-07-21*210.00,4*2023-02-25*210.00," WHERE transferproductid = 5663;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1114', '5', '13', '1', '5663', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '67', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3970';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 1114, 0, 0
                    , 210.00, 9, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1114, 0, 0
                    , 210.00, 4, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1114', '1', '13', '0', '5663', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '54.00', '67', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '111', '1', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4141';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 5, 111, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2021-12-07*155.00," WHERE transferproductid = 5664;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('111', '5', '1', '1', '5664', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '111';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 111, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('111', '1', '1', '0', '5664', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '1', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '432', '20', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '868';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 432, 0, 0
                    , 125.00, 3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-10', 5, 432, 0, 0
                    , 125.00, 17, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-17, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2021-11-08*125.00,17*2022-06-10*125.00," WHERE transferproductid = 5665;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('432', '5', '20', '1', '5665', 'تحويل منتجات من المخزن', 'storemovementController.php', '20.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '135', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '432';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 432, 0, 0
                    , 125.00, 3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-10', 1, 432, 0, 0
                    , 125.00, 17, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+17, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('432', '1', '20', '0', '5665', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '115.00', '135', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '439', '13', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '850';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 439, 0, 0
                    , 170.00, 7, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-7, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 439, 0, 0
                    , 170.00, -6, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2021-11-08*170.00,6*2023-02-25*170.00," WHERE transferproductid = 5666;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('439', '5', '13', '1', '5666', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '13', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '439';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 439, 0, 0
                    , 170.00, 7, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 439, 0, 0
                    , 170.00, 6, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('439', '1', '13', '0', '5666', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '13', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '436', '3', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1638';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 436, 0, 0
                    , 160.00, -3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 160.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2023-02-25*160.00," WHERE transferproductid = 5667;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('436', '5', '3', '1', '5667', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '436';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 436, 0, 0
                    , 160.00, 3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('436', '1', '3', '0', '5667', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '3.00', '6', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '416', '7', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2263';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 5, 416, 0, 0
                    , 140.00, 4, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-4, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 416, 0, 0
                    , 140.00, -3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2022-02-24*140.00,3*2023-02-25*140.00," WHERE transferproductid = 5668;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('416', '5', '7', '1', '5668', 'تحويل منتجات من المخزن', 'storemovementController.php', '6.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '22', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '416';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 416, 0, 0
                    , 140.00, 4, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 416, 0, 0
                    , 140.00, 3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('416', '1', '7', '0', '5668', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '15.00', '22', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '923', '1', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3044';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 923, 0, 0
                    , 200.00, -1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 200.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*200.00," WHERE transferproductid = 5669;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('923', '5', '1', '1', '5669', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '97', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2938';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 923, 0, 0
                    , 200.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('923', '1', '1', '0', '5669', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '96.00', '97', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '99', '5', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1655';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 5, 99, 0, 0
                    , 155.00, 3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 99, 0, 0
                    , 155.00, -2, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2021-12-07*155.00,2*2023-02-25*155.00," WHERE transferproductid = 5670;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('99', '5', '5', '1', '5670', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '99';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 99, 0, 0
                    , 155.00, 3, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 99, 0, 0
                    , 155.00, 2, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('99', '1', '5', '0', '5670', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '5', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '280', '2', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1654';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 280, 0, 0
                    , 150.00, -2, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 150.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2023-02-25*150.00," WHERE transferproductid = 5671;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('280', '5', '2', '1', '5671', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '280';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 280, 0, 0
                    , 150.00, 2, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('280', '1', '2', '0', '5671', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '33.00', '35', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '412', '6', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1659';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 5, 412, 0, 0
                    , 140.00, 6, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2022-02-24*140.00," WHERE transferproductid = 5672;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '5', '6', '1', '5672', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '412';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 412, 0, 0
                    , 140.00, 6, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '1', '6', '0', '5672', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '45.00', '51', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '100', '6', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '23', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1656';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 5, 100, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 100, 0, 0
                    , 155.00, -5, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-03-16*155.00,5*2023-02-25*155.00," WHERE transferproductid = 5673;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '5', '6', '1', '5673', 'تحويل منتجات من المخزن', 'storemovementController.php', '29.00', '23', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '100';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 100, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 100, 0, 0
                    , 155.00, 5, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '6', '0', '5673', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '13.00', '19', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '423', '2', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1647';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 5, 423, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 423, 0, 0
                    , 145.00, -1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-04-15*145.00,1*2023-02-25*145.00," WHERE transferproductid = 5674;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('423', '5', '2', '1', '5674', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '423';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 423, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 423, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('423', '1', '2', '0', '5674', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-1.00', '1', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '414', '9', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1917';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 414, 0, 0
                    , 140.00, -9, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2023-02-25*140.00," WHERE transferproductid = 5675;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('414', '5', '9', '1', '5675', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '414';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 414, 0, 0
                    , 140.00, 9, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('414', '1', '9', '0', '5675', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '9', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '411', '14', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '880';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 411, 0, 0
                    , 135.00, 12, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 411, 0, 0
                    , 135.00, -2, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 135.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2021-11-08*135.00,2*2023-02-25*135.00," WHERE transferproductid = 5676;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('411', '5', '14', '1', '5676', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '14', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '411';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 411, 0, 0
                    , 135.00, 12, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 411, 0, 0
                    , 135.00, 2, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('411', '1', '14', '0', '5676', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '14', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '413', '42', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1646';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 5, 413, 0, 0
                    , 140.00, 29, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-29, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 413, 0, 0
                    , 140.00, -13, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "29*2021-12-07*140.00,13*2023-02-25*140.00," WHERE transferproductid = 5677;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('413', '5', '42', '1', '5677', 'تحويل منتجات من المخزن', 'storemovementController.php', '38.00', '-4', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '207', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '413';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 413, 0, 0
                    , 140.00, 29, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+29, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 413, 0, 0
                    , 140.00, 13, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('413', '1', '42', '0', '5677', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '165.00', '207', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '781', '16', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4039';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 5, 781, 0, 0
                    , 130.00, 15, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 781, 0, 0
                    , 130.00, -1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 130.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "15*2022-07-21*130.00,1*2023-02-25*130.00," WHERE transferproductid = 5678;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('781', '5', '16', '1', '5678', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '535', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2362';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 781, 0, 0
                    , 130.00, 15, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 781, 0, 0
                    , 130.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('781', '1', '16', '0', '5678', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '519.00', '535', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '441', '5', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '883';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 5, 441, 0, 0
                    , 180.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 441, 0, 0
                    , 180.00, -4, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2021-11-08*180.00,4*2023-02-25*180.00," WHERE transferproductid = 5679;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('441', '5', '5', '1', '5679', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '441';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 441, 0, 0
                    , 180.00, 1, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 441, 0, 0
                    , 180.00, 4, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('441', '1', '5', '0', '5679', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '23.00', '28', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '420', '15', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1645';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 5, 420, 0, 0
                    , 145.00, 5, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 420, 0, 0
                    , 145.00, -10, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2022-04-15*145.00,10*2023-02-25*145.00," WHERE transferproductid = 5680;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('420', '5', '15', '1', '5680', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '17', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '420';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 420, 0, 0
                    , 145.00, 5, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 420, 0, 0
                    , 145.00, 10, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('420', '1', '15', '0', '5680', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '2.00', '17', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '421', '5', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4134';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 421, 0, 0
                    , 145.00, -5, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2023-02-25*145.00," WHERE transferproductid = 5681;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('421', '5', '5', '1', '5681', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '421';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 421, 0, 0
                    , 145.00, 5, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('421', '1', '5', '0', '5681', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '5', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '415', '16', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3030';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 5, 415, 0, 0
                    , 140.00, 10, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 415, 0, 0
                    , 140.00, -6, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2022-04-11*140.00,6*2023-02-25*140.00," WHERE transferproductid = 5682;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('415', '5', '16', '1', '5682', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '103', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '415';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 415, 0, 0
                    , 140.00, 10, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 415, 0, 0
                    , 140.00, 6, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('415', '1', '16', '0', '5682', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '87.00', '103', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('5', '1', '438', '15', '2023-02-25', '1', '0','1270',null,null,'2023-02-25 17:18:29',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '844';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 5, 438, 0, 0
                    , 170.00, 8, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 5, 438, 0, 0
                    , 170.00, -7, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2022-03-16*170.00,7*2023-02-25*170.00," WHERE transferproductid = 5683;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('438', '5', '15', '1', '5683', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '438';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 438, 0, 0
                    , 170.00, 8, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 438, 0, 0
                    , 170.00, 7, 0, 0, 1, '2023-02-25 17:18:29')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:18:29' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('438', '1', '15', '0', '5683', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '10.00', '25', '1', '2023-02-25','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:48:30";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 17:18:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 17:18:30', '1', 'editshow', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 13:50:32";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 17:20:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 17:20:32', '1', '', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:18:24";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 17:48:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 17:48:24', '1', 'add', '156.210.24.13', '', 'DESKTOP');
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 deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,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,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment ,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            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;
;;

;
BEGIN;
CALL insertUniqueOptNum(1271,3,1,174,9,'2023-02-25',1,0, '' ,0,0,0,0,0,'2023-02-25 17:48:25',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1404';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 174, 0, 0
                    , 195.00, 9, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2021-11-08*195.00," WHERE transferproductid = 5684;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '3', '9', '1', '5684', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '7', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '174';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 174, 0, 0
                    , 195.00, 9, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '1', '9', '0', '5684', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-1.00', '8', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '81', '2', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1630';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 3, 81, 0, 0
                    , 200.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2021-12-07*200.00," WHERE transferproductid = 5685;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '3', '2', '1', '5685', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '81';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 81, 0, 0
                    , 200.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('81', '1', '2', '0', '5685', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '2', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '216', '14', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1414';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 216, 0, 0
                    , 160.00, 13, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 216, 0, 0
                    , 160.00, -1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 160.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2021-11-08*160.00,1*2023-02-25*160.00," WHERE transferproductid = 5686;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('216', '3', '14', '1', '5686', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '14', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '216';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 216, 0, 0
                    , 160.00, 13, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 216, 0, 0
                    , 160.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('216', '1', '14', '0', '5686', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '14', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '123', '5', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2015';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 123, 0, 0
                    , 200.00, 3, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 123, 0, 0
                    , 200.00, -2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 200.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2022-02-24*200.00,2*2023-02-25*200.00," WHERE transferproductid = 5687;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('123', '3', '5', '1', '5687', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '243', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '123';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 123, 0, 0
                    , 200.00, 3, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 123, 0, 0
                    , 200.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('123', '1', '5', '0', '5687', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '238.00', '243', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '480', '13', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3010';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 480, 0, 0
                    , 180.00, -13, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2023-02-25*180.00," WHERE transferproductid = 5688;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('480', '3', '13', '1', '5688', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '26', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '480';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 480, 0, 0
                    , 180.00, 13, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('480', '1', '13', '0', '5688', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '13.00', '26', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '20', '7', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1597';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 3, 20, 0, 0
                    , 175.00, 6, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 20, 0, 0
                    , 175.00, -1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 175.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2021-12-07*175.00,1*2023-02-25*175.00," WHERE transferproductid = 5689;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('20', '3', '7', '1', '5689', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '20';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 20, 0, 0
                    , 175.00, 6, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 20, 0, 0
                    , 175.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('20', '1', '7', '0', '5689', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '28.00', '35', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '223', '14', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1384';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 223, 0, 0
                    , 160.00, 14, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-14, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "14*2021-11-08*160.00," WHERE transferproductid = 5690;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('223', '3', '14', '1', '5690', 'تحويل منتجات من المخزن', 'storemovementController.php', '11.00', '-3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '223';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 223, 0, 0
                    , 160.00, 14, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('223', '1', '14', '0', '5690', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '1.00', '15', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '495', '26', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1387';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 495, 0, 0
                    , 165.00, 5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 495, 0, 0
                    , 165.00, -21, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 165.00,
                        buyQuantity =buyQuantity+-21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2021-11-08*165.00,21*2023-02-25*165.00," WHERE transferproductid = 5691;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('495', '3', '26', '1', '5691', 'تحويل منتجات من المخزن', 'storemovementController.php', '27.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '26', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '495';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 495, 0, 0
                    , 165.00, 5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 495, 0, 0
                    , 165.00, 21, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('495', '1', '26', '0', '5691', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '26', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '163', '13', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1418';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 163, 0, 0
                    , 165.00, 13, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2021-11-08*165.00," WHERE transferproductid = 5692;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('163', '3', '13', '1', '5692', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '22', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '163';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 163, 0, 0
                    , 165.00, 13, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('163', '1', '13', '0', '5692', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '9.00', '22', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '179', '9', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1416';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 179, 0, 0
                    , 195.00, 9, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2021-11-08*195.00," WHERE transferproductid = 5693;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('179', '3', '9', '1', '5693', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '26', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '179';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 179, 0, 0
                    , 195.00, 9, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('179', '1', '9', '0', '5693', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '17.00', '26', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '178', '9', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1359';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 178, 0, 0
                    , 195.00, 9, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2021-11-08*195.00," WHERE transferproductid = 5694;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('178', '3', '9', '1', '5694', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '178';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 178, 0, 0
                    , 195.00, 9, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('178', '1', '9', '0', '5694', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '9', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '88', '16', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1424';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 88, 0, 0
                    , 200.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 88, 0, 0
                    , 200.00, -4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 200.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2021-11-08*200.00,4*2023-02-25*200.00," WHERE transferproductid = 5695;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('88', '3', '16', '1', '5695', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '88';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 88, 0, 0
                    , 200.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 88, 0, 0
                    , 200.00, 4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('88', '1', '16', '0', '5695', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '16', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '180', '1', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1380';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 180, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2021-11-08*195.00," WHERE transferproductid = 5696;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('180', '3', '1', '1', '5696', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '180';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 180, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('180', '1', '1', '0', '5696', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '1', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '176', '2', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1402';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 176, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2021-11-08*195.00," WHERE transferproductid = 5697;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('176', '3', '2', '1', '5697', 'تحويل منتجات من المخزن', 'storemovementController.php', '6.00', '4', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '176';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 176, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('176', '1', '2', '0', '5697', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '2', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '200', '7', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1436';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 200, 0, 0
                    , 180.00, -7, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2023-02-25*180.00," WHERE transferproductid = 5698;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('200', '3', '7', '1', '5698', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '11', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '200';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 200, 0, 0
                    , 180.00, 7, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('200', '1', '7', '0', '5698', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '4.00', '11', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '17', '17', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1323';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 17, 0, 0
                    , 185.00, 5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 17, 0, 0
                    , 185.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2021-11-08*185.00,12*2022-02-24*185.00," WHERE transferproductid = 5699;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('17', '3', '17', '1', '5699', 'تحويل منتجات من المخزن', 'storemovementController.php', '17.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '33', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '17';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 17, 0, 0
                    , 185.00, 5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 17, 0, 0
                    , 185.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('17', '1', '17', '0', '5699', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '16.00', '33', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '14', '5', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1392';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 14, 0, 0
                    , 150.00, 5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2021-11-08*150.00," WHERE transferproductid = 5700;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14', '3', '5', '1', '5700', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '-4', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '14';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 14, 0, 0
                    , 150.00, 5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('14', '1', '5', '0', '5700', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '10.00', '15', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '800', '17', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2582';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 3, 800, 0, 0
                    , 180.00, 10, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 800, 0, 0
                    , 180.00, -7, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2022-03-16*180.00,7*2023-02-25*180.00," WHERE transferproductid = 5701;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('800', '3', '17', '1', '5701', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '75', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2406';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 800, 0, 0
                    , 180.00, 10, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 800, 0, 0
                    , 180.00, 7, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('800', '1', '17', '0', '5701', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '58.00', '75', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '801', '12', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2581';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 3, 801, 0, 0
                    , 190.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2022-03-16*190.00," WHERE transferproductid = 5702;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('801', '3', '12', '1', '5702', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2407';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 801, 0, 0
                    , 190.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('801', '1', '12', '0', '5702', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '23.00', '35', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '748', '6', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2220';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 748, 0, 0
                    , 185.00, 3, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 748, 0, 0
                    , 185.00, -3, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 185.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2022-02-24*185.00,3*2023-02-25*185.00," WHERE transferproductid = 5703;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('748', '3', '6', '1', '5703', 'تحويل منتجات من المخزن', 'storemovementController.php', '6.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '19', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2167';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 748, 0, 0
                    , 185.00, 3, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 748, 0, 0
                    , 185.00, 3, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('748', '1', '6', '0', '5703', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '13.00', '19', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '747', '7', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2219';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-29', 3, 747, 0, 0
                    , 195.00, 5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 747, 0, 0
                    , 195.00, -2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2022-03-29*195.00,2*2023-02-25*195.00," WHERE transferproductid = 5704;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('747', '3', '7', '1', '5704', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '33', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2166';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-29', 1, 747, 0, 0
                    , 195.00, 5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 747, 0, 0
                    , 195.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('747', '1', '7', '0', '5704', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '26.00', '33', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '1119', '14', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4035';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 1119, 0, 0
                    , 210.00, -14, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "14*2023-02-25*210.00," WHERE transferproductid = 5705;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1119', '3', '14', '1', '5705', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '69', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4009';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1119, 0, 0
                    , 210.00, 14, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1119', '1', '14', '0', '5705', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '55.00', '69', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '1123', '6', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4115';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-20', 3, 1123, 0, 0
                    , 200.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 1123, 0, 0
                    , 200.00, -5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 200.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-08-20*200.00,5*2023-02-25*200.00," WHERE transferproductid = 5706;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1123', '3', '6', '1', '5706', 'تحويل منتجات من المخزن', 'storemovementController.php', '4.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '219', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4094';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-20', 1, 1123, 0, 0
                    , 200.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1123, 0, 0
                    , 200.00, 5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1123', '1', '6', '0', '5706', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '213.00', '219', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '1125', '2', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4116';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 1125, 0, 0
                    , 210.00, -2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2023-02-25*210.00," WHERE transferproductid = 5707;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1125', '3', '2', '1', '5707', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '61', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4096';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1125, 0, 0
                    , 210.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1125', '1', '2', '0', '5707', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '59.00', '61', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '1078', '6', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3909';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-26', 3, 1078, 0, 0
                    , 220.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-06', 3, 1078, 0, 0
                    , 220.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 1078, 0, 0
                    , 220.00, -3, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 220.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2022-06-26*220.00,1*2022-08-06*220.00,3*2023-02-25*220.00," WHERE transferproductid = 5708;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1078', '3', '6', '1', '5708', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '42', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3819';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-06-26', 1, 1078, 0, 0
                    , 220.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-08-06', 1, 1078, 0, 0
                    , 220.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1078, 0, 0
                    , 220.00, 3, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1078', '1', '6', '0', '5708', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '36.00', '42', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '1114', '9', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4025';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 3, 1114, 0, 0
                    , 210.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 1114, 0, 0
                    , 210.00, -1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2022-07-21*210.00,1*2023-02-25*210.00," WHERE transferproductid = 5709;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1114', '3', '9', '1', '5709', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '76', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3970';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 1114, 0, 0
                    , 210.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 1114, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1114', '1', '9', '0', '5709', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '67.00', '76', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '1', '19', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3012';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 3, 1, 0, 0
                    , 150.00, 19, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-19, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "19*2022-04-11*150.00," WHERE transferproductid = 5710;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '3', '19', '1', '5710', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '152', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 1, 0, 0
                    , 150.00, 19, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+19, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1', '1', '19', '0', '5710', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '133.00', '152', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '635', '14', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2014';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 3, 635, 0, 0
                    , 210.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 635, 0, 0
                    , 210.00, -2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2022-07-21*210.00,2*2023-02-25*210.00," WHERE transferproductid = 5711;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('635', '3', '14', '1', '5711', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '5', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '228', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1912';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 635, 0, 0
                    , 210.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 635, 0, 0
                    , 210.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('635', '1', '14', '0', '5711', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '214.00', '228', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '173', '13', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1389';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 173, 0, 0
                    , 195.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 173, 0, 0
                    , 195.00, -1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2021-11-08*195.00,1*2023-02-25*195.00," WHERE transferproductid = 5712;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('173', '3', '13', '1', '5712', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '13', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '173';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 173, 0, 0
                    , 195.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 173, 0, 0
                    , 195.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('173', '1', '13', '0', '5712', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '13', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '525', '8', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1386';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 525, 0, 0
                    , 195.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2021-11-08*195.00," WHERE transferproductid = 5713;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('525', '3', '8', '1', '5713', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '-3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '39', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '525';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 525, 0, 0
                    , 195.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('525', '1', '8', '0', '5713', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '31.00', '39', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '25', '18', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1627';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 3, 25, 0, 0
                    , 170.00, 18, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-18, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2022-04-11*170.00," WHERE transferproductid = 5714;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('25', '3', '18', '1', '5714', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '-5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '25';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 25, 0, 0
                    , 170.00, 18, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('25', '1', '18', '0', '5714', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-23.00', '-5', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '13', '11', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3009';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 3, 13, 0, 0
                    , 175.00, 11, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-11, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "11*2022-04-11*175.00," WHERE transferproductid = 5715;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13', '3', '11', '1', '5715', 'تحويل منتجات من المخزن', 'storemovementController.php', '13.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '13';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 13, 0, 0
                    , 175.00, 11, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('13', '1', '11', '0', '5715', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '5.00', '16', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '501', '18', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3001';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 3, 501, 0, 0
                    , 165.00, 16, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-16, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 501, 0, 0
                    , 165.00, -2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 165.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2022-04-11*165.00,2*2023-02-25*165.00," WHERE transferproductid = 5716;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('501', '3', '18', '1', '5716', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '21', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '501';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 501, 0, 0
                    , 165.00, 16, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 501, 0, 0
                    , 165.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('501', '1', '18', '0', '5716', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '3.00', '21', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '21', '16', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1399';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 21, 0, 0
                    , 185.00, 16, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-16, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2021-11-08*185.00," WHERE transferproductid = 5717;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('21', '3', '16', '1', '5717', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '126', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '21';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 21, 0, 0
                    , 185.00, 16, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('21', '1', '16', '0', '5717', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '110.00', '126', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '490', '17', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1336';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 490, 0, 0
                    , 165.00, 17, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-17, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "17*2021-11-08*165.00," WHERE transferproductid = 5718;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('490', '3', '17', '1', '5718', 'تحويل منتجات من المخزن', 'storemovementController.php', '17.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '17', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '490';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 490, 0, 0
                    , 165.00, 17, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+17, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('490', '1', '17', '0', '5718', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '17', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '12', '20', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3013';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 3, 12, 0, 0
                    , 145.00, 10, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 12, 0, 0
                    , 145.00, -10, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2022-04-11*145.00,10*2023-02-25*145.00," WHERE transferproductid = 5719;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '3', '20', '1', '5719', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '197', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '12';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 12, 0, 0
                    , 145.00, 10, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 12, 0, 0
                    , 145.00, 10, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('12', '1', '20', '0', '5719', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '177.00', '197', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '570', '17', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2218';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 570, 0, 0
                    , 210.00, 17, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-17, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "17*2022-02-24*210.00," WHERE transferproductid = 5720;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('570', '3', '17', '1', '5720', 'تحويل منتجات من المخزن', 'storemovementController.php', '18.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '175', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1529';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 570, 0, 0
                    , 210.00, 17, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+17, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('570', '1', '17', '0', '5720', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '158.00', '175', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '853', '24', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2745';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-29', 3, 853, 0, 0
                    , 220.00, 13, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 853, 0, 0
                    , 220.00, -11, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 220.00,
                        buyQuantity =buyQuantity+-11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2022-03-29*220.00,11*2023-02-25*220.00," WHERE transferproductid = 5721;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('853', '3', '24', '1', '5721', 'تحويل منتجات من المخزن', 'storemovementController.php', '23.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '165', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2703';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-29', 1, 853, 0, 0
                    , 220.00, 13, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 853, 0, 0
                    , 220.00, 11, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('853', '1', '24', '0', '5721', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '141.00', '165', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '634', '23', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2217';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 634, 0, 0
                    , 210.00, 22, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-22, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 634, 0, 0
                    , 210.00, -1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "22*2022-02-24*210.00,1*2023-02-25*210.00," WHERE transferproductid = 5722;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('634', '3', '23', '1', '5722', 'تحويل منتجات من المخزن', 'storemovementController.php', '23.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '262', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1911';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 634, 0, 0
                    , 210.00, 22, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+22, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 634, 0, 0
                    , 210.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('634', '1', '23', '0', '5722', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '239.00', '262', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '181', '40', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1382';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 181, 0, 0
                    , 195.00, 28, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-28, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 181, 0, 0
                    , 195.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "28*2021-11-08*195.00,12*2022-02-24*195.00," WHERE transferproductid = 5723;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('181', '3', '40', '1', '5723', 'تحويل منتجات من المخزن', 'storemovementController.php', '35.00', '-5', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '133', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '181';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 181, 0, 0
                    , 195.00, 28, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+28, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 181, 0, 0
                    , 195.00, 12, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('181', '1', '40', '0', '5723', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '93.00', '133', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '172', '8', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1390';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 172, 0, 0
                    , 195.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2021-11-08*195.00," WHERE transferproductid = 5724;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('172', '3', '8', '1', '5724', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '172';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 172, 0, 0
                    , 195.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('172', '1', '8', '0', '5724', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '8', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '162', '30', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1356';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 162, 0, 0
                    , 135.00, 30, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "30*2021-11-08*135.00," WHERE transferproductid = 5725;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('162', '3', '30', '1', '5725', 'تحويل منتجات من المخزن', 'storemovementController.php', '28.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '162';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 162, 0, 0
                    , 135.00, 30, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('162', '1', '30', '0', '5725', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '30', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '681', '8', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4028';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 3, 681, 0, 0
                    , 155.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2022-07-21*155.00," WHERE transferproductid = 5726;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('681', '3', '8', '1', '5726', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '168', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1965';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 681, 0, 0
                    , 155.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('681', '1', '8', '0', '5726', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '160.00', '168', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '205', '7', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1366';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 205, 0, 0
                    , 135.00, 7, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-7, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2021-11-08*135.00," WHERE transferproductid = 5727;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('205', '3', '7', '1', '5727', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '205';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 205, 0, 0
                    , 135.00, 7, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('205', '1', '7', '0', '5727', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '7', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '781', '21', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4031';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 3, 781, 0, 0
                    , 130.00, 20, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-20, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 781, 0, 0
                    , 130.00, -1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 130.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "20*2022-07-21*130.00,1*2023-02-25*130.00," WHERE transferproductid = 5728;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('781', '3', '21', '1', '5728', 'تحويل منتجات من المخزن', 'storemovementController.php', '20.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '556', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2362';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 781, 0, 0
                    , 130.00, 20, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 781, 0, 0
                    , 130.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('781', '1', '21', '0', '5728', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '535.00', '556', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '422', '1', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3193';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 3, 422, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-04-11*145.00," WHERE transferproductid = 5729;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('422', '3', '1', '1', '5729', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '422';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 422, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('422', '1', '1', '0', '5729', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-1.00', '0', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '111', '2', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1602';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 111, 0, 0
                    , 155.00, -2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2023-02-25*155.00," WHERE transferproductid = 5730;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('111', '3', '2', '1', '5730', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '111';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 111, 0, 0
                    , 155.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('111', '1', '2', '0', '5730', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '1.00', '3', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '431', '2', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3455';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 3, 431, 0, 0
                    , 170.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2022-04-15*170.00," WHERE transferproductid = 5731;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('431', '3', '2', '1', '5731', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '431';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 431, 0, 0
                    , 170.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('431', '1', '2', '0', '5731', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '2', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '439', '1', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2589';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 3, 439, 0, 0
                    , 170.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-03-16*170.00," WHERE transferproductid = 5732;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('439', '3', '1', '1', '5732', 'تحويل منتجات من المخزن', 'storemovementController.php', '17.00', '16', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '14', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '439';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 439, 0, 0
                    , 170.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('439', '1', '1', '0', '5732', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '13.00', '14', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '193', '1', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1426';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 193, 0, 0
                    , 160.00, -1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 160.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*160.00," WHERE transferproductid = 5733;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('193', '3', '1', '1', '5733', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '193';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 193, 0, 0
                    , 160.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('193', '1', '1', '0', '5733', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '1', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '196', '1', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1425';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 196, 0, 0
                    , 170.00, -1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*170.00," WHERE transferproductid = 5734;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('196', '3', '1', '1', '5734', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '196';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 196, 0, 0
                    , 170.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('196', '1', '1', '0', '5734', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '2.00', '3', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '412', '10', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '21', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2209';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 412, 0, 0
                    , 140.00, 6, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 412, 0, 0
                    , 140.00, -4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2022-02-24*140.00,4*2023-02-25*140.00," WHERE transferproductid = 5735;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '3', '10', '1', '5735', 'تحويل منتجات من المخزن', 'storemovementController.php', '31.00', '21', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '61', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '412';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 412, 0, 0
                    , 140.00, 6, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 412, 0, 0
                    , 140.00, 4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '1', '10', '0', '5735', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '51.00', '61', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '99', '10', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-6', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1603';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 3, 99, 0, 0
                    , 155.00, 4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-4, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 99, 0, 0
                    , 155.00, -6, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2021-12-07*155.00,6*2023-02-25*155.00," WHERE transferproductid = 5736;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('99', '3', '10', '1', '5736', 'تحويل منتجات من المخزن', 'storemovementController.php', '4.00', '-6', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '99';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 99, 0, 0
                    , 155.00, 4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 99, 0, 0
                    , 155.00, 6, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('99', '1', '10', '0', '5736', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '5.00', '15', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '412', '21', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2209';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 412, 0, 0
                    , 140.00, -21, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "21*2023-02-25*140.00," WHERE transferproductid = 5737;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '3', '21', '1', '5737', 'تحويل منتجات من المخزن', 'storemovementController.php', '21.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '82', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '412';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 412, 0, 0
                    , 140.00, 21, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+21, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('412', '1', '21', '0', '5737', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '61.00', '82', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '283', '31', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-8', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2204';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 283, 0, 0
                    , 150.00, -31, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 150.00,
                        buyQuantity =buyQuantity+-31, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "31*2023-02-25*150.00," WHERE transferproductid = 5738;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('283', '3', '31', '1', '5738', 'تحويل منتجات من المخزن', 'storemovementController.php', '23.00', '-8', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '95', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '283';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 283, 0, 0
                    , 150.00, 31, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+31, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('283', '1', '31', '0', '5738', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '64.00', '95', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '194', '7', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '11', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1379';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 194, 0, 0
                    , 170.00, 7, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-7, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2021-11-08*170.00," WHERE transferproductid = 5739;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('194', '3', '7', '1', '5739', 'تحويل منتجات من المخزن', 'storemovementController.php', '18.00', '11', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '194';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 194, 0, 0
                    , 170.00, 7, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('194', '1', '7', '0', '5739', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '7', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '415', '13', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3004';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 3, 415, 0, 0
                    , 140.00, 13, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-13, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "13*2022-04-11*140.00," WHERE transferproductid = 5740;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('415', '3', '13', '1', '5740', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '116', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '415';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 415, 0, 0
                    , 140.00, 13, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+13, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('415', '1', '13', '0', '5740', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '103.00', '116', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '92', '1', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1606';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 3, 92, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2021-12-07*145.00," WHERE transferproductid = 5741;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('92', '3', '1', '1', '5741', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '92';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 92, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('92', '1', '1', '0', '5741', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '1', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '103', '5', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1613';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 3, 103, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 103, 0, 0
                    , 155.00, -4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2021-12-07*155.00,4*2023-02-25*155.00," WHERE transferproductid = 5742;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '3', '5', '1', '5742', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '103';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 103, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 103, 0, 0
                    , 155.00, 4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('103', '1', '5', '0', '5742', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '5', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '421', '10', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3006';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 3, 421, 0, 0
                    , 145.00, 10, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-10, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2022-04-11*145.00," WHERE transferproductid = 5743;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('421', '3', '10', '1', '5743', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '421';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-11', 1, 421, 0, 0
                    , 145.00, 10, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('421', '1', '10', '0', '5743', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '5.00', '15', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '93', '2', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1608';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 3, 93, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 93, 0, 0
                    , 145.00, -1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2021-12-07*145.00,1*2023-02-25*145.00," WHERE transferproductid = 5744;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('93', '3', '2', '1', '5744', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '93';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 93, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 93, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('93', '1', '2', '0', '5744', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '2', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '427', '2', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3321';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 3, 427, 0, 0
                    , 145.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2022-04-15*145.00," WHERE transferproductid = 5745;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('427', '3', '2', '1', '5745', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '427';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 427, 0, 0
                    , 145.00, 2, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('427', '1', '2', '0', '5745', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '2', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '100', '12', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1604';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 3, 100, 0, 0
                    , 155.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-8, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 100, 0, 0
                    , 155.00, -4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2022-03-16*155.00,4*2023-02-25*155.00," WHERE transferproductid = 5746;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '3', '12', '1', '5746', 'تحويل منتجات من المخزن', 'storemovementController.php', '11.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '31', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '100';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 100, 0, 0
                    , 155.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 100, 0, 0
                    , 155.00, 4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '12', '0', '5746', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '19.00', '31', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '416', '6', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2205';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 416, 0, 0
                    , 140.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 416, 0, 0
                    , 140.00, -5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-02-24*140.00,5*2023-02-25*140.00," WHERE transferproductid = 5747;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('416', '3', '6', '1', '5747', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '28', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '416';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 416, 0, 0
                    , 140.00, 1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 416, 0, 0
                    , 140.00, 5, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('416', '1', '6', '0', '5747', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '22.00', '28', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '102', '8', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1609';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 102, 0, 0
                    , 155.00, -8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2023-02-25*155.00," WHERE transferproductid = 5748;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '3', '8', '1', '5748', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '102';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 102, 0, 0
                    , 155.00, 8, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '8', '0', '5748', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '8', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '106', '12', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1599';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 3, 106, 0, 0
                    , 155.00, 6, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-6, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 106, 0, 0
                    , 155.00, -6, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "6*2021-12-07*155.00,6*2023-02-25*155.00," WHERE transferproductid = 5749;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('106', '3', '12', '1', '5749', 'تحويل منتجات من المخزن', 'storemovementController.php', '14.00', '2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '12', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '106';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-12-07', 1, 106, 0, 0
                    , 155.00, 6, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 106, 0, 0
                    , 155.00, 6, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('106', '1', '12', '0', '5749', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '12', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '414', '15', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2736';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 414, 0, 0
                    , 140.00, -15, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "15*2023-02-25*140.00," WHERE transferproductid = 5750;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('414', '3', '15', '1', '5750', 'تحويل منتجات من المخزن', 'storemovementController.php', '15.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '414';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 414, 0, 0
                    , 140.00, 15, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('414', '1', '15', '0', '5750', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '9.00', '24', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '185', '4', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1371';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 3, 185, 0, 0
                    , 180.00, 4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-4, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2022-04-15*180.00," WHERE transferproductid = 5751;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('185', '3', '4', '1', '5751', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '65', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '185';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-04-15', 1, 185, 0, 0
                    , 180.00, 4, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('185', '1', '4', '0', '5751', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '61.00', '65', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '194', '14', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1379';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 194, 0, 0
                    , 170.00, 14, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-14, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "14*2021-11-08*170.00," WHERE transferproductid = 5752;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('194', '3', '14', '1', '5752', 'تحويل منتجات من المخزن', 'storemovementController.php', '11.00', '-3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '21', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '194';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 194, 0, 0
                    , 170.00, 14, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('194', '1', '14', '0', '5752', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '7.00', '21', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '184', '3', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1357';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 184, 0, 0
                    , 150.00, -3, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 150.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2023-02-25*150.00," WHERE transferproductid = 5753;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('184', '3', '3', '1', '5753', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '184';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 184, 0, 0
                    , 150.00, 3, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('184', '1', '3', '0', '5753', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '37.00', '40', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '669', '1', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:25',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2018';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 669, 0, 0
                    , 180.00, -1, 0, 0, 1, '2023-02-25 17:48:25')
                ON DUPLICATE KEY UPDATE buyprice = 180.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*180.00," WHERE transferproductid = 5754;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('669', '3', '1', '1', '5754', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '46', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1953';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 669, 0, 0
                    , 180.00, 1, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('669', '1', '1', '0', '5754', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '45.00', '46', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '197', '2', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:26',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1422';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 197, 0, 0
                    , 170.00, 2, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2021-11-08*170.00," WHERE transferproductid = 5755;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('197', '3', '2', '1', '5755', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '197';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 197, 0, 0
                    , 170.00, 2, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('197', '1', '2', '0', '5755', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '2', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '193', '2', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:26',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1426';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 193, 0, 0
                    , 160.00, -2, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyprice = 160.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2023-02-25*160.00," WHERE transferproductid = 5756;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('193', '3', '2', '1', '5756', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '193';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 193, 0, 0
                    , 160.00, 2, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('193', '1', '2', '0', '5756', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '1.00', '3', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '439', '17', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:26',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2589';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 3, 439, 0, 0
                    , 170.00, 14, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-14, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 439, 0, 0
                    , 170.00, -3, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "14*2022-03-16*170.00,3*2023-02-25*170.00," WHERE transferproductid = 5757;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('439', '3', '17', '1', '5757', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '31', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '439';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 439, 0, 0
                    , 170.00, 14, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+14, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 439, 0, 0
                    , 170.00, 3, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('439', '1', '17', '0', '5757', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '14.00', '31', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '195', '5', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:26',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1376';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 195, 0, 0
                    , 170.00, 5, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2021-11-08*170.00," WHERE transferproductid = 5758;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('195', '3', '5', '1', '5758', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '195';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 195, 0, 0
                    , 170.00, 5, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('195', '1', '5', '0', '5758', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '5', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '436', '2', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:26',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2020';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 436, 0, 0
                    , 160.00, -2, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyprice = 160.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2023-02-25*160.00," WHERE transferproductid = 5759;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('436', '3', '2', '1', '5759', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '436';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 436, 0, 0
                    , 160.00, 2, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('436', '1', '2', '0', '5759', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '6.00', '8', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '806', '19', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:26',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2585';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 3, 806, 0, 0
                    , 145.00, 18, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-18, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 806, 0, 0
                    , 145.00, -1, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "18*2022-03-16*145.00,1*2023-02-25*145.00," WHERE transferproductid = 5760;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('806', '3', '19', '1', '5760', 'تحويل منتجات من المخزن', 'storemovementController.php', '18.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '220', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2425';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-03-16', 1, 806, 0, 0
                    , 145.00, 18, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+18, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 806, 0, 0
                    , 145.00, 1, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('806', '1', '19', '0', '5760', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '201.00', '220', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '664', '12', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:26',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2013';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 664, 0, 0
                    , 140.00, -12, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2023-02-25*140.00," WHERE transferproductid = 5761;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('664', '3', '12', '1', '5761', 'تحويل منتجات من المخزن', 'storemovementController.php', '21.00', '9', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '189', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1948';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 664, 0, 0
                    , 140.00, 12, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('664', '1', '12', '0', '5761', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '177.00', '189', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '674', '18', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:26',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2214';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 674, 0, 0
                    , 145.00, 16, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-16, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 674, 0, 0
                    , 145.00, -2, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2022-02-24*145.00,2*2023-02-25*145.00," WHERE transferproductid = 5762;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('674', '3', '18', '1', '5762', 'تحويل منتجات من المخزن', 'storemovementController.php', '17.00', '-1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '143', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1958';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 674, 0, 0
                    , 145.00, 16, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 674, 0, 0
                    , 145.00, 2, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('674', '1', '18', '0', '5762', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '125.00', '143', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '641', '8', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:26',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2213';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 641, 0, 0
                    , 140.00, 2, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-2, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 641, 0, 0
                    , 140.00, -6, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyprice = 140.00,
                        buyQuantity =buyQuantity+-6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2022-02-24*140.00,6*2023-02-25*140.00," WHERE transferproductid = 5763;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('641', '3', '8', '1', '5763', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '84', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1920';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 641, 0, 0
                    , 140.00, 2, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 641, 0, 0
                    , 140.00, 6, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+6, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('641', '1', '8', '0', '5763', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '76.00', '84', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '639', '26', '2023-02-25', '1', '0','1271',null,null,'2023-02-25 17:48:26',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2212';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 3, 639, 0, 0
                    , 125.00, 15, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-15, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 639, 0, 0
                    , 125.00, -11, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyprice = 125.00,
                        buyQuantity =buyQuantity+-11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "15*2022-02-24*125.00,11*2023-02-25*125.00," WHERE transferproductid = 5764;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('639', '3', '26', '1', '5764', 'تحويل منتجات من المخزن', 'storemovementController.php', '19.00', '-7', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '117', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1918';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-02-24', 1, 639, 0, 0
                    , 125.00, 15, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+15, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 639, 0, 0
                    , 125.00, 11, 0, 0, 1, '2023-02-25 17:48:26')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+11, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 17:48:26' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('639', '1', '26', '0', '5764', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '91.00', '117', '1', '2023-02-25','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:18:26";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 17:48:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 17:48:26', '1', 'editshow', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:23:25";
UPDATE user SET loginip = "156.210.24.13", lastactivetime = "2023-02-25 17:53:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 17:53:25', '1', 'addsellBill', '156.210.24.13', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:43:50";
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 < "2023-02-25 14:43:50";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
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 < "2023-02-25 14:44:19";
UPDATE user SET loginip = "41.33.47.149", lastactivetime = "2023-02-25 18:14:19", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 18:14:19', '4', '', '41.33.47.149', '', 'DESKTOP');
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 < "2023-02-25 14:44:20";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:47:19";
UPDATE user SET loginip = "41.33.47.149", lastactivetime = "2023-02-25 18:17:20", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 18:17:20', '4', '', '41.33.47.149', '', 'DESKTOP');
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 < "2023-02-25 14:47:20";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:49:10";
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 < "2023-02-25 14:49:11";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:49:13";
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 < "2023-02-25 14:49:13";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
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 < "2023-02-25 14:49:19";
UPDATE user SET loginip = "41.33.47.149", lastactivetime = "2023-02-25 18:19:19", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 18:19:19', '4', '', '41.33.47.149', '', 'DESKTOP');
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 < "2023-02-25 14:49:19";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:49:43";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:19:43", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 18:19:43', '4', '', '196.155.140.204', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:50:25";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:20:25", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('returnsellbillController.php', '2023-02-25 18:20:25', '4', 'showDetail', '196.155.140.204', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:50:36";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:20:36", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 18:20:36', '4', '', '196.155.140.204', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:51:01";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:21:01", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:21:01', '4', 'showDetail', '196.155.140.204', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:51:06";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:21:06", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 18:21:06', '4', '', '196.155.140.204', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:51:09";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:21:09", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 18:21:09', '4', '', '196.155.140.204', '', 'DESKTOP');
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 < "2023-02-25 14:51:09";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:51:12";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:21:12", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:21:12', '4', 'addsellBill', '196.155.140.204', '', 'DESKTOP');
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 < "2023-02-25 14:51:27";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 18:21:27", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 18:21:27', '5', '', '154.180.143.12', '', 'DESKTOP');
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 < "2023-02-25 14:51:28";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:51:31";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 18:21:31", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:21:31', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:51:36";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:21:36", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 18:21:36', '4', '', '196.155.140.204', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:51:50";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:21:50", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 18:21:50', '4', '', '196.155.140.204', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:51:52";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:21:52", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:21:52', '4', 'addsellBill', '196.155.140.204', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 5;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 14:54:53";
UPDATE user SET loginip = "196.155.140.204", lastactivetime = "2023-02-25 18:24:53", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:24:53', '4', 'addsellBill', '196.155.140.204', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:01:36";
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 < "2023-02-25 15:01:38";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 18:31:38", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 18:31:38', '5', '', '154.180.143.12', '', 'DESKTOP');
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 < "2023-02-25 15:01:38";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:01:40";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 18:31:40", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:31:40', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 5;
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 < "2023-02-25 15:09:15";
UPDATE user SET loginip = "41.33.47.149", lastactivetime = "2023-02-25 18:39:15", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 18:39:15', '4', '', '41.33.47.149', '', 'DESKTOP');
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 < "2023-02-25 15:09:15";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
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 < "2023-02-25 15:11:13";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 18:41:13", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 18:41:13', '5', '', '154.180.143.12', '', 'DESKTOP');
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 < "2023-02-25 15:11:13";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:11:16";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 18:41:16", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:41:16', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:13:25";
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 < "2023-02-25 15:13:26";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:13:28";
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 < "2023-02-25 15:13:28";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
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 < "2023-02-25 15:13:37";
UPDATE user SET loginip = "41.33.47.149", lastactivetime = "2023-02-25 18:43:37", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 18:43:37', '4', '', '41.33.47.149', '', 'DESKTOP');
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 < "2023-02-25 15:13:38";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:13:46";
UPDATE user SET loginip = "41.33.47.149", lastactivetime = "2023-02-25 18:43:46", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:43:46', '4', 'addsellBill', '41.33.47.149', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:14:05";
UPDATE user SET loginip = "41.33.47.149", lastactivetime = "2023-02-25 18:44:05", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2023-02-25 18:44:05', '4', '', '41.33.47.149', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:14:27";
UPDATE user SET loginip = "41.33.47.149", lastactivetime = "2023-02-25 18:44:27", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2023-02-25 18:44:27', '4', 'show', '41.33.47.149', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:14:37";
UPDATE user SET loginip = "41.33.47.149", lastactivetime = "2023-02-25 18:44:37", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:44:37', '4', 'showDetail', '41.33.47.149', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:16:47";
UPDATE user SET loginip = "41.33.47.149", lastactivetime = "2023-02-25 18:46:47", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:46:47', '4', 'showDetail', '41.33.47.149', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:17:01";
UPDATE user SET loginip = "196.155.142.189", lastactivetime = "2023-02-25 18:47:01", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:47:01', '4', 'showDetail', '196.155.142.189', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:17:11";
UPDATE user SET loginip = "196.155.142.189", lastactivetime = "2023-02-25 18:47:11", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:47:11', '4', 'showDetail', '196.155.142.189', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:18:29";
UPDATE user SET loginip = "196.155.142.189", lastactivetime = "2023-02-25 18:48:29", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2023-02-25 18:48:29', '4', 'show', '196.155.142.189', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:19:01";
UPDATE user SET loginip = "196.155.142.189", lastactivetime = "2023-02-25 18:49:01", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:49:01', '4', 'addsellBill', '196.155.142.189', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:21:25";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:51:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:51:26', '1', '', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:22:01";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:52:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:52:01', '1', 'add', '156.210.15.89', '', 'DESKTOP');
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 deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,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,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment ,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            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;
;;

;
BEGIN;
CALL insertUniqueOptNum(1272,3,1,174,19,'2023-02-25',1,0, '' ,0,0,0,0,0,'2023-02-25 18:52:01',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '-12', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1404';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 174, 0, 0
                    , 195.00, 19, 0, 0, 1, '2023-02-25 18:52:01')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-19, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 18:52:01' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "19*2021-11-08*195.00," WHERE transferproductid = 5765;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '3', '19', '1', '5765', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '-12', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '27', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '174';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 174, 0, 0
                    , 195.00, 19, 0, 0, 1, '2023-02-25 18:52:01')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+19, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 18:52:01' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '1', '19', '0', '5765', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '8.00', '27', '1', '2023-02-25','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:22:01";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:52:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:52:01', '1', 'editshow', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:22:35";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:52:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:52:35', '1', 'show', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:22:42";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:52:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:52:42', '1', 'editorder', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:22:55";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:52:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:52:55', '1', '', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:23:01";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:53:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:53:01', '1', 'tempdelete2', '156.210.15.89', '', 'DESKTOP');
BEGIN;
UPDATE storemovement SET  transferproductdate = '2023-02-25', userid = '1', conditions = '1' WHERE transferproductid = '5765';
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '174';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 174, 0, 0
                    , 195.00, -19, 0, 0, 1, '2023-02-25 18:53:01')
                ON DUPLICATE KEY UPDATE buyprice = 195.00,
                        buyQuantity =buyQuantity+-19, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 18:53:01' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "19.00*2023-02-25*195.00," WHERE transferproductid = 5765;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '1', '19.00', '1', '5765', 'حذف تحويل منتجات إلى المخزن', 'storemovementController.php', '27.00', '8', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1404';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 174, 0, 0
                    , 195.00, 19, 0, 0, 1, '2023-02-25 18:53:01')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+19, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 18:53:01' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '3', '19.00', '0', '5765', 'حذف تحويل منتجات من المخزن', 'storemovementController.php', '-12.00', '7', '1', '2023-02-25','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:23:03";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:53:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:53:03', '1', 'sucess', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:23:05";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:53:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:53:05', '1', 'show', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:23:07";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:53:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:53:07', '1', '', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:23:25";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:53:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:53:25', '1', 'add', '156.210.15.89', '', 'DESKTOP');
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 deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,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,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment ,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            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;
;;

;
BEGIN;
CALL insertUniqueOptNum(1273,3,1,174,9,'2023-02-25',1,0, '' ,0,0,0,0,0,'2023-02-25 18:53:25',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1404';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 174, 0, 0
                    , 195.00, 9, 0, 0, 1, '2023-02-25 18:53:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 18:53:25' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2021-11-08*195.00," WHERE transferproductid = 5766;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '3', '9', '1', '5766', 'تحويل منتجات من المخزن', 'storemovementController.php', '7.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '17', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '174';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 174, 0, 0
                    , 195.00, 9, 0, 0, 1, '2023-02-25 18:53:25')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 18:53:25' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('174', '1', '9', '0', '5766', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '8.00', '17', '1', '2023-02-25','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:23:26";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:53:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:53:26', '1', 'editshow', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:23:33";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:53:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:53:33', '1', 'addsellBill', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:23:36";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:53:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:53:36', '1', '', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:23:39";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:53:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:53:39', '1', 'show', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:23:43";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:53:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 18:53:43', '1', 'editorder', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 5;
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 < "2023-02-25 15:24:16";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 18:54:16", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 18:54:16', '5', '', '154.180.143.12', '', 'DESKTOP');
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 < "2023-02-25 15:24:16";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:24:18";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 18:54:19", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:54:19', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:27:28";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:57:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-02-25 18:57:28', '1', '', '156.210.15.89', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 15:27:47";
UPDATE user SET loginip = "156.210.15.89", lastactivetime = "2023-02-25 18:57:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 18:57:47', '1', 'addsellBill', '156.210.15.89', '', 'DESKTOP');
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 < "2023-02-25 16:25:57";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:55:57", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 19:55:57', '8', '', '197.35.48.202', '', 'DESKTOP');
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 < "2023-02-25 16:25:57";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:26:02";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:56:02", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 19:56:02', '8', 'addsellBill', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:27:42";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:57:42", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 19:57:42', '8', 'addAndRetuen', '197.35.48.202', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa4bb22b95d
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 19:56:02', '063fa4bb22b95d', '1', '0.00', '0', '20', '1', '1075', '1055', '1055', '0', '6', '2023-02-25 19:57:42', '', '8', '0', 'نقدي', '6', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1055','0','','0','0','1055','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '8' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10369', '0', '2023-02-25 19:57:42', '8', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1055', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10323;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('160','01183', '10369', '1', '1183', '1', '270', '270', '0', '', '0', '2023-02-25 19:57:42', '1183', '0.00', '0', '6','0','','','0','0','0','0','0','0','0','0','','10323-1,');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 210.00
                where sellbilldetailid = 30242;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1183, '2023-02-25', 264.976744186, 260, 160
                    , 210, 160, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+264.976744186, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (6, '2023-02-25', 264.976744186, 260, 160
                    , 210, 160, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+264.976744186, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '9', userid = '8', storedetaildate = '2023-02-25 19:57:42' WHERE storedetailid = '4359';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1183', '6', '1', '1', '10369', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10.00', '9', '8', '2023-02-25 19:57: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) VALUES ('475','01215', '10369', '1', '1215', '1', '475', '475', '0', '', '0', '2023-02-25 19:57:42', '1215', '0.00', '0', '6','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 482.50, lastbuyprice_withDiscount = 490.00, meanbuyprice_withDiscount = 482.50
                where sellbilldetailid = 30243;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1215, '2023-02-25', 466.162790698, 475, 490
                    , 482.5, 490, 482.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+466.162790698, sellCostBuyPrice =sellCostBuyPrice+475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+482.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+482.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (6, '2023-02-25', 466.162790698, 475, 490
                    , 482.5, 490, 482.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+466.162790698, sellCostBuyPrice =sellCostBuyPrice+475
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+490, sellCostMeanBuyPrice = sellCostMeanBuyPrice+482.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+490, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+482.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '0', userid = '8', storedetaildate = '2023-02-25 19:57:42' WHERE storedetailid = '4482';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1215', '6', '1', '1', '10369', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1.00', '0', '8', '2023-02-25 19:57:42','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 11093;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('330','01188', '10369', '1', '1188', '1', '330', '330', '0', '', '0', '2023-02-25 19:57:42', '1188', '0.00', '0', '6','0','','','0','0','0','0','0','0','0','0','','11093-1,');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
                where sellbilldetailid = 30244;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1188, '2023-02-25', 323.860465116, 330, 330
                    , 330, 330, 330, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+323.860465116, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (6, '2023-02-25', 323.860465116, 330, 330
                    , 330, 330, 330, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+323.860465116, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '0', userid = '8', storedetaildate = '2023-02-25 19:57:42' WHERE storedetailid = '4485';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1188', '6', '1', '1', '10369', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1.00', '0', '8', '2023-02-25 19:57:42','0','0');
UPDATE save SET  savecurrentvalue = '2097',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('1042.00','1055', '0', '6', 'اضافة فاتورة مبيعات', '10369', '2097', '2023-02-25 19:57:42', '8',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 1055, 1065, 980
                    , 1022.5, 980, 1022.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1055, sellCostBuyPrice =sellCostBuyPrice+1065
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+980, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1022.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+980, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1022.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 1055, 1065, 980
                    , 1022.5, 980, 1022.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1055, sellCostBuyPrice =sellCostBuyPrice+1065
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+980, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1022.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+980, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1022.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 1055, 1065, 980
                    , 1022.5, 980, 1022.5, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1055, netSellCostBuyPrice = netSellCostBuyPrice+1065
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+980
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1022.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+980
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1022.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa4bb22b95d and sellbillId = 10369 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:27:42";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:57:42", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 19:57:42', '8', 'addsellBill', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:28:10";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:58:10", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 19:58:10', '8', 'addAndRetuen', '197.35.48.202', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa4c17038ba
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 19:57:43', '063fa4c17038ba', '1', '0.00', '0', '0', '1', '250', '250', '250', '0', '6', '2023-02-25 19:58:10', '', '8', '0', 'نقدي', '6', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','250','0','','0','0','250','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '8' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10370', '0', '2023-02-25 19:58:10', '8', 'sellbillController.php', 'اضافة فاتورة مبيعات', '250', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 4234;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('220','00792', '10370', '1', '792', '1', '250', '250', '0', '', '1', '2023-02-25 19:58:10', '792', '0.00', '0', '6','0','','','0','0','0','0','0','0','1','0','','4234-1,');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
                where sellbilldetailid = 30245;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (792, '2023-02-25', 250, 220, 220
                    , 220, 220, 220, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (6, '2023-02-25', 250, 220, 220
                    , 220, 220, 220, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '42', userid = '8', storedetaildate = '2023-02-25 19:58:10' WHERE storedetailid = '2627';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('792', '6', '1', '1', '10370', 'اضافة فاتورة مبيعات', 'sellbillController.php', '43.00', '42', '8', '2023-02-25 19:58:10','0','0');
UPDATE save SET  savecurrentvalue = '2347',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2097.00','250', '0', '6', 'اضافة فاتورة مبيعات', '10370', '2347', '2023-02-25 19:58:10', '8',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 250, 220, 220
                    , 220, 220, 220, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 250, 220, 220
                    , 220, 220, 220, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 250, 220, 220
                    , 220, 220, 220, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+250, netSellCostBuyPrice = netSellCostBuyPrice+220
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+220
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+220
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa4c17038ba and sellbillId = 10370 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:28:10";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:58:11", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 19:58:11', '8', 'addsellBill', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:28:14";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:58:14", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 19:58:15', '8', '', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:28:34";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:58:34", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 19:58:34', '8', '', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:28:58";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:58:58", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 19:58:58', '8', 'add', '197.35.48.202', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('2', 'جهاد', '', '500', '2023-02-25', '8', '0','-1','6','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '1847',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2347.00','500', '1', '6', 'إضافة مصروف', '2685', '1847', '2023-02-25 19:58:59', '8',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '500', '500', '2023-02-25', '8', '0', '0', '2023-02-25 19:58:59','اضافة اسم مصروف( جهاد )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6322', '145', '500', '','0');
UPDATE accountstree SET name = 'مرتبات', customName = 'مرتبات', parent = '14', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-08', itemtype2 = '0', theValue = '341590', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '145';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6322', '140', '500', '','0');
UPDATE accountstree SET name = 'خزينة محل كفر الدوار', customName = 'خزينة محل كفر الدوار', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-776755', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '140';
UPDATE expenses SET expensestypeid = '2', expensesname = 'جهاد', expensesdetails = '', expensesValue = '500.00', expensesdate = '2023-02-25', userid = '8', conditions = '0',saveid = '6' , dailyentryid = '6322', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2685';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:28:59";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:58:59", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 19:58:59', '8', 'sucess', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:29:00";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:59:01", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 19:59:01', '8', 'show', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:29:03";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:59:03", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 19:59:03', '8', '', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:29:12";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:59:12", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 19:59:12', '8', 'add', '197.35.48.202', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('-1', 'فطار', '', '10', '2023-02-25', '8', '0','-1','6','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '1837',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('1847.00','10', '1', '6', 'إضافة مصروف', '2686', '1837', '2023-02-25 19:59:12', '8',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '10', '10', '2023-02-25', '8', '0', '0', '2023-02-25 19:59:12','اضافة اسم مصروف( فطار )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6323', '160', '10', '','0');
UPDATE accountstree SET name = '', customName = '', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-12-01', itemtype2 = '1', theValue = '-1137880', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '160';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6323', '140', '10', '','0');
UPDATE accountstree SET name = 'خزينة محل كفر الدوار', customName = 'خزينة محل كفر الدوار', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-776765', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '140';
UPDATE expenses SET expensestypeid = '-1', expensesname = 'فطار', expensesdetails = '', expensesValue = '10.00', expensesdate = '2023-02-25', userid = '8', conditions = '0',saveid = '6' , dailyentryid = '6323', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2686';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:29:12";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:59:12", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 19:59:12', '8', 'sucess', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:29:14";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:59:14", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 19:59:19', '8', 'show', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:29:22";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:59:22", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 19:59:22', '8', 'addsellBill', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:29:23";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 19:59:23", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 19:59:23', '8', 'addsellBill', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:31:45";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:01:45", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:01:45', '8', 'addAndRetuen', '197.35.48.202', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa4c7b28b17
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 19:59:23', '063fa4c7b28b17', '1', '0.00', '0', '0', '1', '1095', '1095', '1095', '0', '6', '2023-02-25 20:01:45', '', '8', '0', 'نقدي', '6', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1095','0','','0','0','1095','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '8' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10371', '0', '2023-02-25 20:01:45', '8', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1095', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 11095;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('320','01169', '10371', '1', '1169', '1', '320.00', '320', '0', '', '0', '2023-02-25 20:01:45', '1169', '0.00', '0', '6','0','','','0','0','0','0','0','0','0','0','','11095-1,');
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
                where sellbilldetailid = 30246;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1169, '2023-02-25', 320, 320, 320
                    , 320, 320, 320, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (6, '2023-02-25', 320, 320, 320
                    , 320, 320, 320, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+320, sellCostBuyPrice =sellCostBuyPrice+320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '1', userid = '8', storedetaildate = '2023-02-25 20:01:45' WHERE storedetailid = '4486';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1169', '6', '1', '1', '10371', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2.00', '1', '8', '2023-02-25 20:01:45','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 11091;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('365','01181', '10371', '1', '1181', '1', '365.00', '365', '0', '', '0', '2023-02-25 20:01:45', '1181', '0.00', '0', '6','0','','','0','0','0','0','0','0','0','0','','11091-1,');
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 365.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 365.00
                where sellbilldetailid = 30247;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1181, '2023-02-25', 365, 365, 365
                    , 365, 365, 365, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+365, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (6, '2023-02-25', 365, 365, 365
                    , 365, 365, 365, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+365, sellCostBuyPrice =sellCostBuyPrice+365
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+365
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+365
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '0', userid = '8', storedetaildate = '2023-02-25 20:01:46' WHERE storedetailid = '4484';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1181', '6', '1', '1', '10371', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1.00', '0', '8', '2023-02-25 20:01:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 7482;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('200','01042', '10371', '1', '1042', '1', '200', '200', '0', '', '0', '2023-02-25 20:01:46', '1042', '0.00', '0', '6','0','','','0','0','0','0','0','0','0','0','','7482-1,');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
                where sellbilldetailid = 30248;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1042, '2023-02-25', 200, 200, 200
                    , 200, 200, 200, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (6, '2023-02-25', 200, 200, 200
                    , 200, 200, 200, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '3', userid = '8', storedetaildate = '2023-02-25 20:01:46' WHERE storedetailid = '3667';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1042', '6', '1', '1', '10371', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4.00', '3', '8', '2023-02-25 20:01:46','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 7712;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('210','01064', '10371', '1', '1064', '1', '210', '210', '0', '', '0', '2023-02-25 20:01:46', '1064', '0.00', '0', '6','0','','','0','0','0','0','0','0','0','0','','7712-1,');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 210.00
                where sellbilldetailid = 30249;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1064, '2023-02-25', 210, 210, 210
                    , 210, 210, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (6, '2023-02-25', 210, 210, 210
                    , 210, 210, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+210
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '5', userid = '8', storedetaildate = '2023-02-25 20:01:46' WHERE storedetailid = '3750';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1064', '6', '1', '1', '10371', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6.00', '5', '8', '2023-02-25 20:01:46','0','0');
UPDATE save SET  savecurrentvalue = '2932',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('1837.00','1095', '0', '6', 'اضافة فاتورة مبيعات', '10371', '2932', '2023-02-25 20:01:46', '8',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 1095, 1095, 1095
                    , 1095, 1095, 1095, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1095, sellCostBuyPrice =sellCostBuyPrice+1095
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1095, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1095
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1095, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1095
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 1095, 1095, 1095
                    , 1095, 1095, 1095, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1095, sellCostBuyPrice =sellCostBuyPrice+1095
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1095, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1095
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1095, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1095
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 1095, 1095, 1095
                    , 1095, 1095, 1095, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1095, netSellCostBuyPrice = netSellCostBuyPrice+1095
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1095
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1095
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1095
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1095
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa4c7b28b17 and sellbillId = 10371 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:31:46";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:01:46", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:01:46', '8', 'addsellBill', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:32:07";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:02:07", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 20:02:07', '8', '', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:33:59";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:03:59", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:03:59', '8', '', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:34:18";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:04:18", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:04:18', '8', 'add', '197.35.48.202', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('3', 'حسن حمدي', '', '500', '2023-02-25', '8', '0','-1','6','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '2432',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2932.00','500', '1', '6', 'إضافة مصروف', '2687', '2432', '2023-02-25 20:04:18', '8',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '500', '500', '2023-02-25', '8', '0', '0', '2023-02-25 20:04:18','اضافة اسم مصروف( حسن حمدي )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6324', '146', '500', '','0');
UPDATE accountstree SET name = 'ايجار', customName = 'ايجار', parent = '14', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-08', itemtype2 = '0', theValue = '250495', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '146';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6324', '140', '500', '','0');
UPDATE accountstree SET name = 'خزينة محل كفر الدوار', customName = 'خزينة محل كفر الدوار', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-777265', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '140';
UPDATE expenses SET expensestypeid = '3', expensesname = 'حسن حمدي', expensesdetails = '', expensesValue = '500.00', expensesdate = '2023-02-25', userid = '8', conditions = '0',saveid = '6' , dailyentryid = '6324', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2687';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:34:19";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:04:19", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:04:19', '8', 'sucess', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:34:20";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:04:20", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:04:20', '8', 'show', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:34:23";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:04:23", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:04:23', '8', '', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:34:30";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:04:31", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:04:31', '8', 'add', '197.35.48.202', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('-1', 'فطار', '', '10', '2023-02-25', '8', '0','-1','6','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '2422',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2432.00','10', '1', '6', 'إضافة مصروف', '2688', '2422', '2023-02-25 20:04:31', '8',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '10', '10', '2023-02-25', '8', '0', '0', '2023-02-25 20:04:31','اضافة اسم مصروف( فطار )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6325', '160', '10', '','0');
UPDATE accountstree SET name = '', customName = '', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-12-01', itemtype2 = '1', theValue = '-1137890', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '160';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6325', '140', '10', '','0');
UPDATE accountstree SET name = 'خزينة محل كفر الدوار', customName = 'خزينة محل كفر الدوار', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-777275', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '140';
UPDATE expenses SET expensestypeid = '-1', expensesname = 'فطار', expensesdetails = '', expensesValue = '10.00', expensesdate = '2023-02-25', userid = '8', conditions = '0',saveid = '6' , dailyentryid = '6325', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2688';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:34:31";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:04:31", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:04:31', '8', 'sucess', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:34:32";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:04:33", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:04:33', '8', 'show', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:34:36";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:04:36", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 20:04:36', '8', '', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:37:17";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:07:17", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:07:17', '8', '', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:37:59";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:07:59", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:07:59', '8', 'add', '197.35.48.202', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('11', 'كهرباء', '', '100', '2023-02-25', '8', '0','-1','6','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '2322',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2422.00','100', '1', '6', 'إضافة مصروف', '2689', '2322', '2023-02-25 20:07:59', '8',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '100', '100', '2023-02-25', '8', '0', '0', '2023-02-25 20:07:59','اضافة اسم مصروف( كهرباء )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6326', '154', '100', '','0');
UPDATE accountstree SET name = 'ادوات كهربائيه', customName = 'ادوات كهربائيه', parent = '14', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-08', itemtype2 = '0', theValue = '5575', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '154';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6326', '140', '100', '','0');
UPDATE accountstree SET name = 'خزينة محل كفر الدوار', customName = 'خزينة محل كفر الدوار', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-777375', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '140';
UPDATE expenses SET expensestypeid = '11', expensesname = 'كهرباء', expensesdetails = '', expensesValue = '100.00', expensesdate = '2023-02-25', userid = '8', conditions = '0',saveid = '6' , dailyentryid = '6326', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2689';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:37:59";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:07:59", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:07:59', '8', 'sucess', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:38:01";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:08:01", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:08:01', '8', 'show', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:38:02";
UPDATE user SET loginip = "197.35.48.202", lastactivetime = "2023-02-25 20:08:02", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 20:08:02', '8', '', '197.35.48.202', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:55:57";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:25:57", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:25:57', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:56:07";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:26:07", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:26:07', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:56:53";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:26:53", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:26:53', '7', 'addAndRetuen', '197.192.238.254', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa52bf7da48
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 20:26:07', '063fa52bf7da48', '1', '0.00', '0', '10', '1', '230', '220', '-220', '0', '5', '2023-02-25 20:26:53', '', '7', '0', 'نقدي','5', '0', '5', '0', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-220','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '7' 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 ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','3705', '0', '2023-02-25 20:26:53', '7', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '220', '0', null, '0', null, null,'', '0','1','1','0','1');
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) VALUES ('220.00', '01140', '3705', '1', '1140', '1', '230.00', '230', '0', '', '0', '0', '1140', '0.00', '0','5','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
                where returnsellbilldetailid = 7854;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1140, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 240, 220, 220, 220
                    , 220, 220, 0, 0, 1)
                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
                        , returnSellVal = returnSellVal+240, returnSellCostBuyPrice = returnSellCostBuyPrice+220, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+220
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+220, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+220
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+220
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (5, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 240, 220, 220, 220
                    , 220, 220, 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
                        , returnSellVal = returnSellVal+240, returnSellCostBuyPrice = returnSellCostBuyPrice+220, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+220
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+220, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+220
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+220
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '3', userid = '7', storedetaildate = '2023-02-25 20:26:53' WHERE storedetailid = '4167';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1140', '5', '1', '0', '3705', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '2.00', '3', '7', '2023-02-25 20:26:53','0','0');
UPDATE save SET  savecurrentvalue = '680',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('900.00','220', '1', '5', 'اضافة فاتورة مردوات مبيعات', '3705', '680', '2023-02-25 20:26:53', '7',  'returnsellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 220, 220, 220, 220
                    , 220, 220, 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
                        , returnSellVal = returnSellVal+220, returnSellCostBuyPrice = returnSellCostBuyPrice+220, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+220
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+220, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+220
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+220
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 220, 220, 220, 220
                    , 220, 220, 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
                        , returnSellVal = returnSellVal+220, returnSellCostBuyPrice = returnSellCostBuyPrice+220, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+220
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+220, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+220
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+220
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, -220, -220, -220
                    , -220, -220, -220, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-220, netSellCostBuyPrice = netSellCostBuyPrice+-220
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-220
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-220
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa52bf7da48 and sellbillId = 3705 and returnsellbillId = 3705
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:56:54";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:26:54", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:26:54', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:58:48";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:28:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:28:48', '7', 'addAndRetuen', '197.192.238.254', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa52ee73ef2
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 20:26:54', '063fa52ee73ef2', '1', '0.00', '0', '50', '1', '270', '220', '-220', '0', '5', '2023-02-25 20:28:48', '', '7', '0', 'نقدي','5', '0', '5', '0', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-220','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '7' 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 ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','3706', '0', '2023-02-25 20:28:48', '7', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '220', '0', null, '0', null, null,'', '0','1','1','0','1');
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) VALUES ('270.00', '01161', '3706', '1', '1161', '1', '270.00', '270', '0', '', '0', '0', '1161', '0.00', '0','5','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
                where returnsellbilldetailid = 7855;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1161, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 320, 270, 270, 270
                    , 270, 270, 0, 0, 1)
                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
                        , returnSellVal = returnSellVal+320, returnSellCostBuyPrice = returnSellCostBuyPrice+270, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+270
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+270, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+270
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+270
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (5, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 320, 270, 270, 270
                    , 270, 270, 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
                        , returnSellVal = returnSellVal+320, returnSellCostBuyPrice = returnSellCostBuyPrice+270, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+270
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+270, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+270
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+270
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '11', userid = '7', storedetaildate = '2023-02-25 20:28:48' WHERE storedetailid = '4253';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1161', '5', '1', '0', '3706', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '10.00', '11', '7', '2023-02-25 20:28:48','0','0');
UPDATE save SET  savecurrentvalue = '460',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('680.00','220', '1', '5', 'اضافة فاتورة مردوات مبيعات', '3706', '460', '2023-02-25 20:28:48', '7',  'returnsellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 220, 270, 270, 270
                    , 270, 270, 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
                        , returnSellVal = returnSellVal+220, returnSellCostBuyPrice = returnSellCostBuyPrice+270, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+270
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+270, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+270
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+270
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 220, 270, 270, 270
                    , 270, 270, 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
                        , returnSellVal = returnSellVal+220, returnSellCostBuyPrice = returnSellCostBuyPrice+270, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+270
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+270, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+270
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+270
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, -220, -270, -270
                    , -270, -270, -270, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-220, netSellCostBuyPrice = netSellCostBuyPrice+-270
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-270
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-270
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-270
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-270
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa52ee73ef2 and sellbillId = 3706 and returnsellbillId = 3706
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:58:49";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:28:49", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:28:49', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:59:08";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:29:08", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:29:08', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:59:08";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:29:08", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:29:08', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:59:53";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:29:53", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:29:53', '7', 'addAndRetuen', '197.192.238.254', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa5374ee28e
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 20:29:08', '063fa5374ee28e', '1', '0.00', '0', '20', '1', '460', '440', '440', '0', '5', '2023-02-25 20:29:53', '', '7', '0', 'نقدي', '5', '0', '3', '0', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','440','0','','0','0','440','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '7' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10372', '0', '2023-02-25 20:29:53', '7', 'sellbillController.php', 'اضافة فاتورة مبيعات', '440', '0', null, '0', null, null,'', '0','1','1','0','1');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('220','01140', '10372', '1', '1140', '2', '230.00', '460', '0', '', '0', '2023-02-25 20:29:54', '1140', '0.00', '0', '5','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 220.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 220.00
                where sellbilldetailid = 30250;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1140, '2023-02-25', 440, 440, 440
                    , 440, 440, 440, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (5, '2023-02-25', 440, 440, 440
                    , 440, 440, 440, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '1', userid = '7', storedetaildate = '2023-02-25 20:29:54' WHERE storedetailid = '4167';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1140', '5', '2', '1', '10372', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3.00', '1', '7', '2023-02-25 20:29:54','0','0');
UPDATE save SET  savecurrentvalue = '900',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('460.00','440', '0', '5', 'اضافة فاتورة مبيعات', '10372', '900', '2023-02-25 20:29:54', '7',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 440, 440, 440
                    , 440, 440, 440, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 440, 440, 440
                    , 440, 440, 440, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 440, 440, 440
                    , 440, 440, 440, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+440, netSellCostBuyPrice = netSellCostBuyPrice+440
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+440
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+440
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+440
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+440
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa5374ee28e and sellbillId = 10372 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 16:59:57";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:29:57", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:29:57', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:00:02";
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:00:05";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:30:05", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 20:30:05', '7', '', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:00:16";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:30:16", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:30:16', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
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 < "2023-02-25 17:00:30";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:30:30", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 20:30:30', '3', '', '156.201.37.214', '', 'DESKTOP');
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 < "2023-02-25 17:00:30";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:00:48";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:30:48", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:30:48', '3', 'addsellBill', '156.201.37.214', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:03:53";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:33:53", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:33:53', '7', 'addAndRetuen', '197.192.238.254', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa53b88b702
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 20:30:16', '063fa53b88b702', '1', '0.00', '0', '25', '1', '535', '510', '510', '0', '5', '2023-02-25 20:33:53', '', '7', '0', 'نقدي', '5', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','510','0','','0','0','510','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '7' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10373', '0', '2023-02-25 20:33:53', '7', 'sellbillController.php', 'اضافة فاتورة مبيعات', '510', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 9458;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('240','00466', '10373', '1', '466', '1', '175.00', '175', '0', '', '0', '2023-02-25 20:33:53', '466', '0.00', '0', '5','0','','','0','0','0','0','0','0','0','0','','9458-1,');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 191.88, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 191.88
                where sellbilldetailid = 30251;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (466, '2023-02-25', 166.822429907, 175, 240
                    , 191.88, 240, 191.88, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+166.822429907, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+191.88
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+191.88
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (5, '2023-02-25', 166.822429907, 175, 240
                    , 191.88, 240, 191.88, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+166.822429907, sellCostBuyPrice =sellCostBuyPrice+175
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+191.88
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+191.88
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '48', userid = '7', storedetaildate = '2023-02-25 20:33:53' WHERE storedetailid = '4165';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('466', '5', '1', '1', '10373', 'اضافة فاتورة مبيعات', 'sellbillController.php', '49.00', '48', '7', '2023-02-25 20:33:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 514;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('150','00336', '10373', '1', '336', '1', '165.00', '165', '0', '', '0', '2023-02-25 20:33:53', '336', '0.00', '0', '5','0','','','0','0','0','0','0','0','0','0','','514-1,');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
                where sellbilldetailid = 30252;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (336, '2023-02-25', 157.289719626, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+157.289719626, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (5, '2023-02-25', 157.289719626, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+157.289719626, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '17', userid = '7', storedetaildate = '2023-02-25 20:33:53' WHERE storedetailid = '809';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('336', '5', '1', '1', '10373', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18.00', '17', '7', '2023-02-25 20:33:53','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 5158;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('195','00854', '10373', '1', '854', '1', '195.00', '195', '0', '', '0', '2023-02-25 20:33:53', '854', '0.00', '0', '5','0','','','0','0','0','0','0','0','0','0','','5158-1,');
UPDATE sellbilldetail SET  lastbuyprice = 195.00 , meanbuyprice = 195.00, lastbuyprice_withDiscount = 195.00, meanbuyprice_withDiscount = 195.00
                where sellbilldetailid = 30253;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (854, '2023-02-25', 185.887850467, 195, 195
                    , 195, 195, 195, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185.887850467, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (5, '2023-02-25', 185.887850467, 195, 195
                    , 195, 195, 195, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+185.887850467, sellCostBuyPrice =sellCostBuyPrice+195
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+195, sellCostMeanBuyPrice = sellCostMeanBuyPrice+195
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+195, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+195
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '8', userid = '7', storedetaildate = '2023-02-25 20:33:53' WHERE storedetailid = '3029';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('854', '5', '1', '1', '10373', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9.00', '8', '7', '2023-02-25 20:33:53','0','0');
UPDATE save SET  savecurrentvalue = '1410',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('900.00','510', '0', '5', 'اضافة فاتورة مبيعات', '10373', '1410', '2023-02-25 20:33:53', '7',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 510, 520, 585
                    , 536.88, 585, 536.88, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+585, sellCostMeanBuyPrice = sellCostMeanBuyPrice+536.88
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+585, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+536.88
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 510, 520, 585
                    , 536.88, 585, 536.88, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+510, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+585, sellCostMeanBuyPrice = sellCostMeanBuyPrice+536.88
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+585, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+536.88
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 510, 520, 585
                    , 536.88, 585, 536.88, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+510, netSellCostBuyPrice = netSellCostBuyPrice+520
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+585
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+536.88
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+585
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+536.88
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa53b88b702 and sellbillId = 10373 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:03:54";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:33:54", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:33:54', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:04:27";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:34:27", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:34:27', '3', 'addAndRetuen', '156.201.37.214', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa53d8eae4b
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 20:30:48', '063fa53d8eae4b', '1', '0.00', '0', '50', '1', '770', '720', '720', '0', '8', '2023-02-25 20:34:28', '', '3', '0', 'نقدي', '8', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','720','0','','0','0','720','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '3' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10374', '0', '2023-02-25 20:34:28', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '720', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10671;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('270','01171', '10374', '1', '1171', '1', '270', '270', '0', '', '0', '2023-02-25 20:34:28', '1171', '0.00', '0', '8','0','','','0','0','0','0','0','0','0','0','','10671-1,');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
                where sellbilldetailid = 30254;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1171, '2023-02-25', 252.467532468, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+252.467532468, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2023-02-25', 252.467532468, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+252.467532468, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '1', userid = '3', storedetaildate = '2023-02-25 20:34:28' WHERE storedetailid = '4305';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1171', '8', '1', '1', '10374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2.00', '1', '3', '2023-02-25 20:34:28','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 9620;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('185','00125', '10374', '1', '125', '1', '150', '150', '0', '', '0', '2023-02-25 20:34:28', '125', '0.00', '0', '8','0','','','0','0','0','0','0','0','0','0','','9620-1,');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30255;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (125, '2023-02-25', 140.25974026, 150, 185
                    , 167.5, 185, 167.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140.25974026, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+167.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+167.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2023-02-25', 140.25974026, 150, 185
                    , 167.5, 185, 167.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+140.25974026, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+167.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+167.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '9', userid = '3', storedetaildate = '2023-02-25 20:34:28' WHERE storedetailid = '4196';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('125', '8', '1', '1', '10374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10.00', '9', '3', '2023-02-25 20:34: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) VALUES ('175','00466', '10374', '1', '466', '2', '175', '350', '0', '', '0', '2023-02-25 20:34:28', '466', '0.00', '0', '8','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 191.88, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 191.88
                where sellbilldetailid = 30256;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (466, '2023-02-25', 327.272727273, 350, 480
                    , 383.76, 480, 383.76, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+327.272727273, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+383.76
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+383.76
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (8, '2023-02-25', 327.272727273, 350, 480
                    , 383.76, 480, 383.76, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+327.272727273, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+383.76
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+383.76
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '15', userid = '3', storedetaildate = '2023-02-25 20:34:28' WHERE storedetailid = '1196';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('466', '8', '2', '1', '10374', 'اضافة فاتورة مبيعات', 'sellbillController.php', '17.00', '15', '3', '2023-02-25 20:34:28','0','0');
UPDATE save SET  savecurrentvalue = '775',  userid = '3' WHERE saveid = '8';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('55.00','720', '0', '8', 'اضافة فاتورة مبيعات', '10374', '775', '2023-02-25 20:34:28', '3',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 720, 770, 935
                    , 821.26, 935, 821.26, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+720, sellCostBuyPrice =sellCostBuyPrice+770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+935, sellCostMeanBuyPrice = sellCostMeanBuyPrice+821.26
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+935, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+821.26
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 720, 770, 935
                    , 821.26, 935, 821.26, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+720, sellCostBuyPrice =sellCostBuyPrice+770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+935, sellCostMeanBuyPrice = sellCostMeanBuyPrice+821.26
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+935, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+821.26
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 720, 770, 935
                    , 821.26, 935, 821.26, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+720, netSellCostBuyPrice = netSellCostBuyPrice+770
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+935
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+821.26
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+935
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+821.26
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa53d8eae4b and sellbillId = 10374 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:04:28";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:34:28", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:34:28', '3', 'addsellBill', '156.201.37.214', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:05:06";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:35:06", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:35:06', '7', 'addAndRetuen', '197.192.238.254', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa549261623
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 20:33:54', '063fa549261623', '1', '0.00', '0', '5', '1', '430', '425', '425', '0', '5', '2023-02-25 20:35:07', '', '7', '0', 'نقدي', '5', '0', '3', '0', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','425','0','','0','0','425','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '7' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10375', '0', '2023-02-25 20:35:07', '7', 'sellbillController.php', 'اضافة فاتورة مبيعات', '425', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 712;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('220','00516', '10375', '1', '516', '1', '150.00', '150', '0', '', '0', '2023-02-25 20:35:07', '516', '0.00', '0', '5','0','','','0','0','0','0','0','0','0','0','','712-1,');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 185.00
                where sellbilldetailid = 30257;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (516, '2023-02-25', 148.255813953, 150, 220
                    , 185, 220, 185, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+148.255813953, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (5, '2023-02-25', 148.255813953, 150, 220
                    , 185, 220, 185, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+148.255813953, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '3', userid = '7', storedetaildate = '2023-02-25 20:35:07' WHERE storedetailid = '907';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('516', '5', '1', '1', '10375', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4.00', '3', '7', '2023-02-25 20:35:07','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) VALUES ('280','01174', '10375', '1', '1174', '1', '280.00', '280', '0', '', '0', '2023-02-25 20:35:07', '1174', '0.00', '0', '5','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
                where sellbilldetailid = 30258;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1174, '2023-02-25', 276.744186047, 280, 280
                    , 280, 280, 280, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+276.744186047, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (5, '2023-02-25', 276.744186047, 280, 280
                    , 280, 280, 280, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+276.744186047, sellCostBuyPrice =sellCostBuyPrice+280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '0', userid = '7', storedetaildate = '2023-02-25 20:35:07' WHERE storedetailid = '4313';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1174', '5', '1', '1', '10375', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1.00', '0', '7', '2023-02-25 20:35:07','0','0');
UPDATE save SET  savecurrentvalue = '1835',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('1410.00','425', '0', '5', 'اضافة فاتورة مبيعات', '10375', '1835', '2023-02-25 20:35:07', '7',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 425, 430, 500
                    , 465, 500, 465, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+425, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 425, 430, 500
                    , 465, 500, 465, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+425, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+465
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+465
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 425, 430, 500
                    , 465, 500, 465, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+425, netSellCostBuyPrice = netSellCostBuyPrice+430
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+500
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+465
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+500
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+465
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa549261623 and sellbillId = 10375 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:05:07";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:35:07", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:35:07', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:06:21";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:36:21", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:36:21', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:08:22";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:38:22", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:38:22', '7', 'addAndRetuen', '197.192.238.254', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa55256e5da
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 20:36:21', '063fa55256e5da', '1', '0.00', '0', '5', '1', '180', '175', '175', '0', '5', '2023-02-25 20:38:23', '', '7', '0', 'نقدي', '5', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','175','0','','0','0','175','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '7' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10376', '0', '2023-02-25 20:38:23', '7', 'sellbillController.php', 'اضافة فاتورة مبيعات', '175', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 712;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('220','00516', '10376', '1', '516', '1', '180.00', '180', '0', '', '1', '2023-02-25 20:38:23', '516', '0.00', '0', '5','0','','','0','0','0','0','0','0','1','0','','712-1,');
UPDATE sellbilldetail SET  lastbuyprice = 220.00 , meanbuyprice = 185.00, lastbuyprice_withDiscount = 220.00, meanbuyprice_withDiscount = 185.00
                where sellbilldetailid = 30259;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (516, '2023-02-25', 175, 150, 220
                    , 185, 220, 185, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+175, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (5, '2023-02-25', 175, 150, 220
                    , 185, 220, 185, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+175, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '2', userid = '7', storedetaildate = '2023-02-25 20:38:23' WHERE storedetailid = '907';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('516', '5', '1', '1', '10376', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3.00', '2', '7', '2023-02-25 20:38:23','0','0');
UPDATE save SET  savecurrentvalue = '2010',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('1835.00','175', '0', '5', 'اضافة فاتورة مبيعات', '10376', '2010', '2023-02-25 20:38:23', '7',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 175, 150, 220
                    , 185, 220, 185, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+175, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 175, 150, 220
                    , 185, 220, 185, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+175, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+185
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 175, 150, 220
                    , 185, 220, 185, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+175, netSellCostBuyPrice = netSellCostBuyPrice+150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+220
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+185
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+220
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+185
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa55256e5da and sellbillId = 10376 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:08:23";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:38:23", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:38:23', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:08:32";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:38:32", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 20:38:32', '7', '', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:08:40";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 20:38:40", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 20:38:41', '7', 'showDetail', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:10:10";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:40:10", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:40:10', '3', 'addAndRetuen', '156.201.37.214', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa54b4983c3
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 20:34:28', '063fa54b4983c3', '1', '0.00', '0', '150', '1', '2530', '2380', '2380', '0', '8', '2023-02-25 20:40:10', '', '3', '0', 'نقدي', '8', '0', '3', '0', 'نقدي', '13' ,'0','','','','','-1','0','0','0','0','0','2380','0','','0','0','2380','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '3' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10377', '0', '2023-02-25 20:40:10', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2380', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 10889;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('185','00124', '10377', '1', '124', '4', '150', '600', '0', '', '0', '2023-02-25 20:40:10', '124', '0.00', '0', '8','0','','','0','0','0','0','0','0','0','0','','10889-4,');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 160.63, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 160.63
                where sellbilldetailid = 30260;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (124, '2023-02-25', 564.42687747, 600, 740
                    , 642.52, 740, 642.52, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+564.42687747, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+642.52
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+642.52
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (8, '2023-02-25', 564.42687747, 600, 740
                    , 642.52, 740, 642.52, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+564.42687747, sellCostBuyPrice =sellCostBuyPrice+600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+740, sellCostMeanBuyPrice = sellCostMeanBuyPrice+642.52
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+740, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+642.52
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '28', userid = '3', storedetaildate = '2023-02-25 20:40:10' WHERE storedetailid = '4197';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('124', '8', '4', '1', '10377', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32.00', '28', '3', '2023-02-25 20:40: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) VALUES ('230','01037', '10377', '1', '1037', '2', '230', '460', '0', '', '0', '2023-02-25 20:40:10', '1037', '0.00', '0', '8','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
                where sellbilldetailid = 30261;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1037, '2023-02-25', 432.727272727, 460, 460
                    , 460, 460, 460, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+432.727272727, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (8, '2023-02-25', 432.727272727, 460, 460
                    , 460, 460, 460, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+432.727272727, sellCostBuyPrice =sellCostBuyPrice+460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '0', userid = '3', storedetaildate = '2023-02-25 20:40:10' WHERE storedetailid = '3610';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1037', '8', '2', '1', '10377', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2.00', '0', '3', '2023-02-25 20:40:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10036;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('270','01164', '10377', '1', '1164', '1', '270', '270', '0', '', '0', '2023-02-25 20:40:10', '1164', '0.00', '0', '8','0','','','0','0','0','0','0','0','0','0','','10036-1,');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
                where sellbilldetailid = 30262;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1164, '2023-02-25', 253.992094862, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+253.992094862, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2023-02-25', 253.992094862, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+253.992094862, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '12', userid = '3', storedetaildate = '2023-02-25 20:40:10' WHERE storedetailid = '4264';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1164', '8', '1', '1', '10377', 'اضافة فاتورة مبيعات', 'sellbillController.php', '13.00', '12', '3', '2023-02-25 20:40:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 2002;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('160','00216', '10377', '1', '216', '3', '170', '510', '0', '', '0', '2023-02-25 20:40:10', '216', '0.00', '0', '8','0','','','0','0','0','0','0','0','0','0','','2002-3,');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 160.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 160.00
                where sellbilldetailid = 30263;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (216, '2023-02-25', 479.76284585, 480, 480
                    , 480, 480, 480, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+479.76284585, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (8, '2023-02-25', 479.76284585, 480, 480
                    , 480, 480, 480, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+479.76284585, sellCostBuyPrice =sellCostBuyPrice+480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '12', userid = '3', storedetaildate = '2023-02-25 20:40:10' WHERE storedetailid = '1569';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('216', '8', '3', '1', '10377', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15.00', '12', '3', '2023-02-25 20:40:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10038;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('260','01165', '10377', '1', '1165', '1', '270', '270', '0', '', '0', '2023-02-25 20:40:10', '1165', '0.00', '0', '8','0','','','0','0','0','0','0','0','0','0','','10038-1,');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
                where sellbilldetailid = 30264;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1165, '2023-02-25', 253.992094862, 260, 260
                    , 260, 260, 260, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+253.992094862, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2023-02-25', 253.992094862, 260, 260
                    , 260, 260, 260, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+253.992094862, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '4', userid = '3', storedetaildate = '2023-02-25 20:40:10' WHERE storedetailid = '4265';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1165', '8', '1', '1', '10377', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5.00', '4', '3', '2023-02-25 20:40:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10889;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('185','00124', '10377', '1', '124', '1', '150', '150', '0', '', '0', '2023-02-25 20:40:10', '124', '0.00', '0', '8','0','','','0','0','0','0','0','0','0','0','','10889-1,');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 160.63, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 160.63
                where sellbilldetailid = 30265;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (124, '2023-02-25', 141.106719368, 150, 185
                    , 160.63, 185, 160.63, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+141.106719368, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160.63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160.63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2023-02-25', 141.106719368, 150, 185
                    , 160.63, 185, 160.63, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+141.106719368, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+160.63
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+185, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+160.63
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '27', userid = '3', storedetaildate = '2023-02-25 20:40:10' WHERE storedetailid = '4197';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('124', '8', '1', '1', '10377', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28.00', '27', '3', '2023-02-25 20:40:10','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10331;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('160','01183', '10377', '1', '1183', '1', '270', '270', '0', '', '0', '2023-02-25 20:40:10', '1183', '0.00', '0', '8','0','','','0','0','0','0','0','0','0','0','','10331-1,');
UPDATE sellbilldetail SET  lastbuyprice = 160.00 , meanbuyprice = 210.00, lastbuyprice_withDiscount = 160.00, meanbuyprice_withDiscount = 210.00
                where sellbilldetailid = 30266;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1183, '2023-02-25', 253.992094862, 260, 160
                    , 210, 160, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+253.992094862, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2023-02-25', 253.992094862, 260, 160
                    , 210, 160, 210, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+253.992094862, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+210
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+210
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '14', userid = '3', storedetaildate = '2023-02-25 20:40:10' WHERE storedetailid = '4363';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1183', '8', '1', '1', '10377', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15.00', '14', '3', '2023-02-25 20:40:10','0','0');
UPDATE save SET  savecurrentvalue = '3155',  userid = '3' WHERE saveid = '8';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('775.00','2380', '0', '8', 'اضافة فاتورة مبيعات', '10377', '3155', '2023-02-25 20:40:10', '3',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 2380, 2480, 2555
                    , 2483.15, 2555, 2483.15, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2380, sellCostBuyPrice =sellCostBuyPrice+2480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2555, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2483.15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2483.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 2380, 2480, 2555
                    , 2483.15, 2555, 2483.15, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2380, sellCostBuyPrice =sellCostBuyPrice+2480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2555, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2483.15
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2555, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2483.15
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 2380, 2480, 2555
                    , 2483.15, 2555, 2483.15, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2380, netSellCostBuyPrice = netSellCostBuyPrice+2480
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2555
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2483.15
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2555
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2483.15
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa54b4983c3 and sellbillId = 10377 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:10:11";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:40:11", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:40:11', '3', 'addsellBill', '156.201.37.214', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:10:14";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:40:14", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 20:40:14', '3', '', '156.201.37.214', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:10:40";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:40:40", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:40:40', '3', '', '156.201.37.214', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:10:50";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:40:50", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:40:50', '3', 'add', '156.201.37.214', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('-1', 'القبض بدون النسبه', '', '850', '2023-02-25', '3', '0','-1','8','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '2305',  userid = '3' WHERE saveid = '8';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('3155.00','850', '1', '8', 'إضافة مصروف', '2690', '2305', '2023-02-25 20:40:50', '3',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '850', '850', '2023-02-25', '3', '0', '0', '2023-02-25 20:40:50','اضافة اسم مصروف( القبض بدون النسبه )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6327', '160', '850', '','0');
UPDATE accountstree SET name = '', customName = '', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-12-01', itemtype2 = '1', theValue = '-1138740', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '160';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6327', '142', '850', '','0');
UPDATE accountstree SET name = 'خزينة محل ابو كريم', customName = 'خزينة محل ابو كريم', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1021038', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '142';
UPDATE expenses SET expensestypeid = '-1', expensesname = 'القبض بدون النسبه', expensesdetails = '', expensesValue = '850.00', expensesdate = '2023-02-25', userid = '3', conditions = '0',saveid = '8' , dailyentryid = '6327', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2690';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:10:50";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:40:50", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:40:50', '3', 'sucess', '156.201.37.214', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:10:52";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:40:52", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 20:40:52', '3', 'show', '156.201.37.214', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:10:53";
UPDATE user SET loginip = "156.201.37.214", lastactivetime = "2023-02-25 20:40:54", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 20:40:54', '3', '', '156.201.37.214', '', 'DESKTOP');
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 < "2023-02-25 17:14:43";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:44:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 20:44:43', '1', '', '156.210.48.135', '', 'DESKTOP');
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 < "2023-02-25 17:14:43";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:16:01";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:46:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:46:01', '1', '', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:17:52";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:47:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:47:52', '1', 'show', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:18:02";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:48:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:48:02', '1', 'editorder', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:18:53";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:48:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:48:53', '1', '', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:19:18";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:49:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:49:18', '1', 'show', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:20:11";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:50:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:50:11', '1', 'editorder', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:20:12";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:50:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:50:12', '1', 'editorder', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:20:13";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:50:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:50:14', '1', 'editorder', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:21:51";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:51:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:51:51', '1', '', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:27:53";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:57:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:57:53', '1', 'add', '156.210.48.135', '', 'DESKTOP');
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 deloperationnum INT,IN sizeid INT,IN colorid INT,IN driverid INT,IN drivertimeout INT,IN driverdate datetime,IN delivererid INT,IN deliverdate datetime,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,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,comment ,
                lastopt,
                deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            SELECT LAST_INSERT_ID(),lastopt INTO inserted_id,optnum_used;
ELSE

    INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions,comment,operationnum ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate)
                VALUES (storeidfrom, storeidto, productid,transferproductamount, transferproductdate, userid, conditions ,comment
                ,optnum
                ,deloperationnum,sizeid,colorid,driverid,drivertimeout,driverdate,delivererid,deliverdate);
            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;
;;

;
BEGIN;
CALL insertUniqueOptNum(1274,3,1,439,3,'2023-02-25',1,0, '' ,0,0,0,0,0,'2023-02-25 20:57:54',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '-4', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '2589';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 439, 0, 0
                    , 170.00, -3, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyprice = 170.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2023-02-25*170.00," WHERE transferproductid = 5767;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('439', '3', '3', '1', '5767', 'تحويل منتجات من المخزن', 'storemovementController.php', '-1.00', '-4', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '439';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 439, 0, 0
                    , 170.00, 3, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('439', '1', '3', '0', '5767', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '31.00', '34', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '681', '1', '2023-02-25', '1', '0','1274',null,null,'2023-02-25 20:57:54',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '4028';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 3, 681, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2022-07-21*155.00," WHERE transferproductid = 5768;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('681', '3', '1', '1', '5768', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '1', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '169', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1965';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2022-07-21', 1, 681, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('681', '1', '1', '0', '5768', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '168.00', '169', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '102', '1', '2023-02-25', '1', '0','1274',null,null,'2023-02-25 20:57:54',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1609';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 102, 0, 0
                    , 155.00, -1, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*155.00," WHERE transferproductid = 5769;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '3', '1', '1', '5769', 'تحويل منتجات من المخزن', 'storemovementController.php', '-1.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '102';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 102, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '1', '0', '5769', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '8.00', '9', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '106', '2', '2023-02-25', '1', '0','1274',null,null,'2023-02-25 20:57:54',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1599';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 106, 0, 0
                    , 155.00, -2, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2023-02-25*155.00," WHERE transferproductid = 5770;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('106', '3', '2', '1', '5770', 'تحويل منتجات من المخزن', 'storemovementController.php', '2.00', '0', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '14', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '106';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 106, 0, 0
                    , 155.00, 2, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('106', '1', '2', '0', '5770', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '12.00', '14', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '421', '10', '2023-02-25', '1', '0','1274',null,null,'2023-02-25 20:57:54',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-10', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '3006';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 421, 0, 0
                    , 145.00, -10, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyprice = 145.00,
                        buyQuantity =buyQuantity+-10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2023-02-25*145.00," WHERE transferproductid = 5771;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('421', '3', '10', '1', '5771', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-10', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '25', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '421';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 421, 0, 0
                    , 145.00, 10, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('421', '1', '10', '0', '5771', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '15.00', '25', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '100', '1', '2023-02-25', '1', '0','1274',null,null,'2023-02-25 20:57:54',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1604';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 100, 0, 0
                    , 155.00, -1, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*155.00," WHERE transferproductid = 5772;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '3', '1', '1', '5772', 'تحويل منتجات من المخزن', 'storemovementController.php', '-1.00', '-2', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '100';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 100, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('100', '1', '1', '0', '5772', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '31.00', '32', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '102', '1', '2023-02-25', '1', '0','1274',null,null,'2023-02-25 20:57:54',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1609';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 3, 102, 0, 0
                    , 155.00, -1, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-02-25*155.00," WHERE transferproductid = 5773;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '3', '1', '1', '5773', 'تحويل منتجات من المخزن', 'storemovementController.php', '-2.00', '-3', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '102';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-02-25', 1, 102, 0, 0
                    , 155.00, 1, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('102', '1', '1', '0', '5773', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '9.00', '10', '1', '2023-02-25','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('3', '1', '162', '3', '2023-02-25', '1', '0','1274',null,null,'2023-02-25 20:57:54',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-5', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '1356';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 3, 162, 0, 0
                    , 135.00, 3, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-3, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2021-11-08*135.00," WHERE transferproductid = 5774;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('162', '3', '3', '1', '5774', 'تحويل منتجات من المخزن', 'storemovementController.php', '-2.00', '-5', '1', '2023-02-25','0','0');
UPDATE storedetail SET  productquantity = '33', userid = '1', storedetaildate = '2023-02-25' WHERE storedetailid = '162';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2021-11-08', 1, 162, 0, 0
                    , 135.00, 3, 0, 0, 1, '2023-02-25 20:57:54')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-02-25 20:57:54' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('162', '1', '3', '0', '5774', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '30.00', '33', '1', '2023-02-25','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:27:54";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:57:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-02-25 20:57:54', '1', 'editshow', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:29:03";
UPDATE user SET loginip = "156.210.48.135", lastactivetime = "2023-02-25 20:59:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 20:59:03', '1', 'addsellBill', '156.210.48.135', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:30:58";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:00:58", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:00:58', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 5;
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 < "2023-02-25 17:36:05";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 21:06:05", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 21:06:05', '5', '', '154.180.143.12', '', 'DESKTOP');
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 < "2023-02-25 17:36:05";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:36:19";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 21:06:19", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:06:19', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 5;
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 < "2023-02-25 17:41:27";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 21:11:28", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 21:11:28', '5', '', '154.180.143.12', '', 'DESKTOP');
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 < "2023-02-25 17:41:28";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 17:43:56";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 21:13:56", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:13:56', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:06:46";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:36:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 21:36:46', '7', '', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:06:59";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:36:59", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:36:59', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:07:47";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:37:47", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:37:48', '7', 'addAndRetuen', '197.192.238.254', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa635b5bfb2
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 21:36:59', '063fa635b5bfb2', '1', '0.00', '0', '10', '1', '180', '170', '170', '0', '5', '2023-02-25 21:37:48', '', '7', '0', 'نقدي', '5', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','170','0','','0','0','170','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '7' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10378', '0', '2023-02-25 21:37:48', '7', 'sellbillController.php', 'اضافة فاتورة مبيعات', '170', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 11181;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('210','00517', '10378', '1', '517', '1', '180', '180', '0', '', '1', '2023-02-25 21:37:48', '517', '0.00', '0', '5','0','','','0','0','0','0','0','0','1','0','','11181-1,');
UPDATE sellbilldetail SET  lastbuyprice = 210.00 , meanbuyprice = 180.00, lastbuyprice_withDiscount = 210.00, meanbuyprice_withDiscount = 180.00
                where sellbilldetailid = 30267;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (517, '2023-02-25', 170, 150, 210
                    , 180, 210, 180, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (5, '2023-02-25', 170, 150, 210
                    , 180, 210, 180, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '3', userid = '7', storedetaildate = '2023-02-25 21:37:48' WHERE storedetailid = '908';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('517', '5', '1', '1', '10378', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4.00', '3', '7', '2023-02-25 21:37:48','0','0');
UPDATE save SET  savecurrentvalue = '2180',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2010.00','170', '0', '5', 'اضافة فاتورة مبيعات', '10378', '2180', '2023-02-25 21:37:48', '7',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 170, 150, 210
                    , 180, 210, 180, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 170, 150, 210
                    , 180, 210, 180, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+170, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+210, sellCostMeanBuyPrice = sellCostMeanBuyPrice+180
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+210, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+180
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 170, 150, 210
                    , 180, 210, 180, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+170, netSellCostBuyPrice = netSellCostBuyPrice+150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+210
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+180
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+210
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+180
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa635b5bfb2 and sellbillId = 10378 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:07:48";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:37:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:37:48', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:08:23";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:38:23", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:38:23', '7', 'addAndRetuen', '197.192.238.254', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa638ca1fec
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 21:37:48', '063fa638ca1fec', '1', '0.00', '0', '20', '1', '270', '250', '250', '0', '5', '2023-02-25 21:38:24', '', '7', '0', 'نقدي', '5', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','250','0','','0','0','250','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '7' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10379', '0', '2023-02-25 21:38:24', '7', 'sellbillController.php', 'اضافة فاتورة مبيعات', '250', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 10002;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('270','01161', '10379', '1', '1161', '1', '270.00', '270', '0', '', '0', '2023-02-25 21:38:24', '1161', '0.00', '0', '5','0','','','0','0','0','0','0','0','0','0','','10002-1,');
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
                where sellbilldetailid = 30268;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1161, '2023-02-25', 250, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (5, '2023-02-25', 250, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '10', userid = '7', storedetaildate = '2023-02-25 21:38:24' WHERE storedetailid = '4253';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1161', '5', '1', '1', '10379', 'اضافة فاتورة مبيعات', 'sellbillController.php', '11.00', '10', '7', '2023-02-25 21:38:24','0','0');
UPDATE save SET  savecurrentvalue = '2430',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2180.00','250', '0', '5', 'اضافة فاتورة مبيعات', '10379', '2430', '2023-02-25 21:38:24', '7',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 250, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 250, 270, 270
                    , 270, 270, 270, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+250, sellCostBuyPrice =sellCostBuyPrice+270
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+270, sellCostMeanBuyPrice = sellCostMeanBuyPrice+270
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+270, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+270
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 250, 270, 270
                    , 270, 270, 270, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+250, netSellCostBuyPrice = netSellCostBuyPrice+270
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+270
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+270
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+270
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+270
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa638ca1fec and sellbillId = 10379 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:08:24";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:38:24", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:38:24', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:08:50";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:38:51", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:38:51', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:09:35";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:39:35", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:39:35', '7', 'addAndRetuen', '197.192.238.254', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa63cb4ff5a
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 21:38:51', '063fa63cb4ff5a', '1', '0.00', '0', '0', '1', '180', '180', '-180', '0', '5', '2023-02-25 21:39:35', '', '7', '0', 'نقدي','5', '0', '5', '0', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-180','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '0', userid = '7' 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 ) VALUES ('1','0.00','0','1','اضافة فاتورة مردوات مبيعات','3707', '0', '2023-02-25 21:39:35', '7', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '180', '0', null, '0', null, null,'', '0','1','1','0','1');
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) VALUES ('150.00', '00125', '3707', '1', '125', '1', '180', '180', '0', '', '1', '0', '125', '0.00', '0','5','0','','','0','0','0','0','0','1');
UPDATE returnsellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where returnsellbilldetailid = 7856;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (125, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 180, 150, 185, 167.5
                    , 185, 167.5, 0, 0, 1)
                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
                        , returnSellVal = returnSellVal+180, returnSellCostBuyPrice = returnSellCostBuyPrice+150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+185
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+167.5, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+185
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+167.5
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (5, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 180, 150, 185, 167.5
                    , 185, 167.5, 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
                        , returnSellVal = returnSellVal+180, returnSellCostBuyPrice = returnSellCostBuyPrice+150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+185
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+167.5, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+185
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+167.5
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '9', userid = '7', storedetaildate = '2023-02-25 21:39:35' WHERE storedetailid = '914';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('125', '5', '1', '0', '3707', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '8.00', '9', '7', '2023-02-25 21:39:35','0','0');
UPDATE save SET  savecurrentvalue = '2250',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2430.00','180', '1', '5', 'اضافة فاتورة مردوات مبيعات', '3707', '2250', '2023-02-25 21:39:35', '7',  'returnsellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 180, 150, 185, 167.5
                    , 185, 167.5, 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
                        , returnSellVal = returnSellVal+180, returnSellCostBuyPrice = returnSellCostBuyPrice+150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+185
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+167.5, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+185
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+167.5
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 0, 0, 0
                    , 0, 0, 0, 0
                    , 180, 150, 185, 167.5
                    , 185, 167.5, 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
                        , returnSellVal = returnSellVal+180, returnSellCostBuyPrice = returnSellCostBuyPrice+150, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+185
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+167.5, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+185
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+167.5
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, -180, -150, -185
                    , -167.5, -185, -167.5, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-180, netSellCostBuyPrice = netSellCostBuyPrice+-150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-185
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-167.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-185
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-167.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa63cb4ff5a and sellbillId = 3707 and returnsellbillId = 3707
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:09:36";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:39:36", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:39:36', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:09:43";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:39:43", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 21:39:43', '7', '', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:09:48";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:39:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 21:39:48', '7', 'showDetail', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:18:25";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:48:25", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 21:48:25', '7', '', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:18:46";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:48:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 21:48:46', '7', 'add', '197.192.238.254', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('2', 'عمادحمدي', '', '50', '2023-02-25', '7', '0','-1','5','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '2200',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2250.00','50', '1', '5', 'إضافة مصروف', '2691', '2200', '2023-02-25 21:48:46', '7',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '50', '50', '2023-02-25', '7', '0', '0', '2023-02-25 21:48:46','اضافة اسم مصروف( عمادحمدي )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6328', '145', '50', '','0');
UPDATE accountstree SET name = 'مرتبات', customName = 'مرتبات', parent = '14', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-08', itemtype2 = '0', theValue = '341640', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '145';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6328', '139', '50', '','0');
UPDATE accountstree SET name = 'خزينة محل عبدالله', customName = 'خزينة محل عبدالله', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2022-07-06', itemtype2 = '1', theValue = '-1469399', theOrder = '0', layingOrder = '',reportid = '0' WHERE id = '139';
UPDATE expenses SET expensestypeid = '2', expensesname = 'عمادحمدي', expensesdetails = '', expensesValue = '50.00', expensesdate = '2023-02-25', userid = '7', conditions = '0',saveid = '5' , dailyentryid = '6328', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '2691';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:18:46";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:48:47", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 21:48:47', '7', 'sucess', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:18:48";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 21:48:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2023-02-25 21:48:48', '7', 'show', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 5;
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 < "2023-02-25 18:21:48";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 21:51:48", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 21:51:48', '5', '', '154.180.143.12', '', 'DESKTOP');
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 < "2023-02-25 18:21:48";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:21:50";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 21:51:50", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 21:51:50', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 5;
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 < "2023-02-25 18:24:16";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 21:54:16", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 21:54:16', '5', '', '154.180.143.12', '', 'DESKTOP');
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 < "2023-02-25 18:24:16";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:31:20";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:01:20", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 22:01:20', '5', '', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:31:40";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:01:40", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 22:01:40', '5', 'add', '154.180.143.12', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =15689
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(320,@clientdebt,@clientname);
UPDATE client SET  clientdebt = '0' , clientdate = '2023-02-25 22:01:41', userid = '5' WHERE clientid = '320';
UPDATE client SET  inUse = 0 where clientid = 320;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('320','745.00','745','1','ايصال تحصيل (( قبض من عميل ))','15689', '0', '2023-02-25 22:01:20', '5', 'clientPayedDeptController.php', '   ', '745', '0', null, '0', null, null,'', '-1','1','1','1','1');
UPDATE save SET  savecurrentvalue = '2695',  userid = '5' WHERE saveid = '3';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('1950.00','745', '0', '3', 'ايصال تحصيل (( قبض من عميل ))', '15689', '2695', '2023-02-25 22:01:41', '5',  'clientPayedDeptController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '745', '745', '2023-02-25', '5', '0', '0', '2023-02-25 22:01:41','اضافة ايصال سداد للعميل جمال مهران المحل القديم','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6329', '137', '745', '','0');
UPDATE accountstree SET name = 'خزينة رائد', customName = 'خزينة رائد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2022-07-06', itemtype2 = '1', theValue = '-842575', theOrder = '0', layingOrder = '',reportid = '0' WHERE id = '137';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6329', '399', '745', '','0');
UPDATE accountstree SET name = 'جمال مهران المحل القديم', customName = 'جمال مهران المحل القديم', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '5', mydate = '2023-02-02', itemtype2 = '1', theValue = '-745', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '399';
UPDATE clientdebtchange SET clientid = '320', clientdebtchangebefore = '745.00', clientdebtchangeamount = '745.00', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '15689', clientdebtchangeafter = '0.00', clientdebtchangedate = '2023-02-25 22:01:20', userid = '5', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '745.00',discount='', reciptid=null, dailyentryid = '6329',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1',saveConversionFactor='1' WHERE clientdebtchangeid = '15689';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:31:41";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:01:41", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 22:01:41', '5', 'sucess', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:31:42";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:01:42", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 22:01:42', '5', 'show', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:31:57";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:01:57", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 22:01:58', '5', '', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:32:00";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:02:00", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:02:00', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:33:28";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:03:28", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:03:28', '5', 'addAndRetuen', '154.180.143.12', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa6938d8608
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 22:02:00', '063fa6938d8608', '1', '0.00', '0', '0', '1', '290', '290', '290', '0', '3', '2023-02-25 22:03:28', '', '5', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '1' ,'0','','','','','-1','0','0','0','0','0','290','0','','0','0','290','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '5' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10380', '0', '2023-02-25 22:03:28', '5', 'sellbillController.php', 'اضافة فاتورة مبيعات', '290', '0', null, '0', null, null,'', '0','1','1','0','1');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('290','01157', '10380', '1', '1157', '1', '290', '290', '0', '', '0', '2023-02-25 22:03:28', '1157', '0.00', '0', '3','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 327.50, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 327.50
                where sellbilldetailid = 30269;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1157, '2023-02-25', 290, 290, 365
                    , 327.5, 365, 327.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+327.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+327.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (3, '2023-02-25', 290, 290, 365
                    , 327.5, 365, 327.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+327.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+327.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '1', userid = '5', storedetaildate = '2023-02-25 22:03:28' WHERE storedetailid = '4229';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1157', '3', '1', '1', '10380', 'اضافة فاتورة مبيعات', 'sellbillController.php', '2.00', '1', '5', '2023-02-25 22:03:28','0','0');
UPDATE save SET  savecurrentvalue = '2985',  userid = '5' WHERE saveid = '3';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2695.00','290', '0', '3', 'اضافة فاتورة مبيعات', '10380', '2985', '2023-02-25 22:03:28', '5',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 290, 290, 365
                    , 327.5, 365, 327.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+327.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+327.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 290, 290, 365
                    , 327.5, 365, 327.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+290
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+365, sellCostMeanBuyPrice = sellCostMeanBuyPrice+327.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+365, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+327.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 290, 290, 365
                    , 327.5, 365, 327.5, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+290, netSellCostBuyPrice = netSellCostBuyPrice+290
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+365
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+327.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+365
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+327.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa6938d8608 and sellbillId = 10380 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:33:28";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:03:28", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:03:28', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:33:54";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:03:54", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:03:54', '5', 'addAndRetuen', '154.180.143.12', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 063fa6990eb161
-- ----------------------------------------------------------------------------------------------------

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) VALUES ('2023-02-25 22:03:28', '063fa6990eb161', '1', '0.00', '0', '50', '1', '350', '300', '300', '0', '3', '2023-02-25 22:03:54', '', '5', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','300','0','','0','0','300','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '5' 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 ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','10381', '0', '2023-02-25 22:03:54', '5', 'sellbillController.php', 'اضافة فاتورة مبيعات', '300', '0', null, '0', null, null,'', '0','1','1','0','1');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('150','00383', '10381', '1', '383', '2', '175.00', '350', '0', '', '0', '2023-02-25 22:03:54', '383', '0.00', '0', '3','0','','','0','0','0','0','0','0','0','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 185.00 , meanbuyprice = 167.50, lastbuyprice_withDiscount = 185.00, meanbuyprice_withDiscount = 167.50
                where sellbilldetailid = 30270;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (383, '2023-02-25', 300, 300, 370
                    , 335, 370, 335, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+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)
                    VALUES (3, '2023-02-25', 300, 300, 370
                    , 335, 370, 335, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '2', userid = '5', storedetaildate = '2023-02-25 22:03:54' WHERE storedetailid = '1443';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('383', '3', '2', '1', '10381', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4.00', '2', '5', '2023-02-25 22:03:54','0','0');
UPDATE save SET  savecurrentvalue = '3285',  userid = '5' WHERE saveid = '3';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2985.00','300', '0', '3', 'اضافة فاتورة مبيعات', '10381', '3285', '2023-02-25 22:03:54', '5',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2023-02-25', 300, 300, 370
                    , 335, 370, 335, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2023-02-25', 300, 300, 370
                    , 335, 370, 335, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+300, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+370, sellCostMeanBuyPrice = sellCostMeanBuyPrice+335
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+370, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+335
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 300, 300, 370
                    , 335, 370, 335, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+300, netSellCostBuyPrice = netSellCostBuyPrice+300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+370
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+335
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+370
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+335
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 063fa6990eb161 and sellbillId = 10381 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:33:55";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:03:55", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:03:55', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:33:57";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:03:57", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 22:03:57', '5', '', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:35:44";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:05:44", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 22:05:44', '5', 'showDetail', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:44:37";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:14:37", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:14:37', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:45:05";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:15:05", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 22:15:06', '5', '', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:46:10";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:16:10", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:16:10', '5', 'showDetail', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 18:46:23";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 22:16:24", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:16:24', '5', 'addsellBill', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 5;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:15:12";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:45:12", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:45:12', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:17:51";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:47:51", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 22:47:51', '7', '', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:18:20";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:48:20", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 22:48:20', '7', 'add', '197.192.238.254', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =15692
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(47,@clientdebt,@clientname);
UPDATE client SET  clientdebt = '1910' , clientdate = '2023-02-25 22:48:20', userid = '7' WHERE clientid = '47';
UPDATE client SET  inUse = 0 where clientid = 47;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('47','2910.00','1000','1','ايصال تحصيل (( قبض من عميل ))','15692', '1910', '2023-02-25 22:47:51', '7', 'clientPayedDeptController.php', '   ', '1000', '0', null, '0', null, null,'', '-1','1','1','1','1');
UPDATE save SET  savecurrentvalue = '3200',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('2200.00','1000', '0', '5', 'ايصال تحصيل (( قبض من عميل ))', '15692', '3200', '2023-02-25 22:48:20', '7',  'clientPayedDeptController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '1000', '1000', '2023-02-25', '7', '0', '0', '2023-02-25 22:48:20','اضافة ايصال سداد للعميل ام نوره','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6330', '139', '1000', '','0');
UPDATE accountstree SET name = 'خزينة محل عبدالله', customName = 'خزينة محل عبدالله', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2022-07-06', itemtype2 = '1', theValue = '-1468399', theOrder = '0', layingOrder = '',reportid = '0' WHERE id = '139';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6330', '100', '1000', '','0');
UPDATE accountstree SET name = 'ام نوره', customName = 'ام نوره', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-3385', theOrder = '0', layingOrder = '',reportid = '0' WHERE id = '100';
UPDATE clientdebtchange SET clientid = '47', clientdebtchangebefore = '2910.00', clientdebtchangeamount = '1000.00', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '15692', clientdebtchangeafter = '1910.00', clientdebtchangedate = '2023-02-25 22:47:51', userid = '7', tablename = 'clientPayedDeptController.php', comment = '   ', totalOperationCost = '1000.00',discount='', reciptid=null, dailyentryid = '6330',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1',saveConversionFactor='1' WHERE clientdebtchangeid = '15692';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:18:21";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:48:21", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 22:48:21', '7', 'sucess', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:18:22";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:48:22", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2023-02-25 22:48:22', '7', 'show', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:18:32";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:48:32", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:48:32', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:18:44";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:48:44", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-02-25 22:48:44', '7', 'addsellBill', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:22:09";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:52:09", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2023-02-25 22:52:09', '7', '', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:22:11";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:52:11", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 22:52:11', '7', '', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:22:12";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:52:12", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 22:52:12', '7', '', '197.192.238.254', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 19:22:43";
UPDATE user SET loginip = "197.192.238.254", lastactivetime = "2023-02-25 22:52:43", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 22:52:43', '7', 'showDetail', '197.192.238.254', '', 'DESKTOP');
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 < "2023-02-25 20:12:39";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 23:42:39", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-02-25 23:42:39', '5', '', '154.180.143.12', '', 'DESKTOP');
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 < "2023-02-25 20:12:39";
DROP PROCEDURE IF EXISTS clientInUse;;

CREATE PROCEDURE clientInUse(IN id INT,OUT debtis VARCHAR(256),OUT nameis 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 INTO debtis,nameis FROM client WHERE clientid = id ;
    ELSE
        SELECT "in_use","in_use" INTO debtis,nameis;
    END IF;

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 20:12:42";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 23:42:42", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('supplierPayedDeptController.php', '2023-02-25 23:42:43', '5', '', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 20:13:07";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 23:43:07", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('supplierPayedDeptController.php', '2023-02-25 23:43:07', '5', 'add', '154.180.143.12', '', 'DESKTOP');
BEGIN;
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor) VALUES ('1', '-1588651.00', '3000', '1', 'ايصال دفع لمورد', '451', '-1591651', '2023-02-25 23:42:43', '5', 'supplierPayedDeptController.php', 'جمعبه اودي', '0','3', '-1','1','1','1','1');
UPDATE supplier SET  suppliercurrentDebt = '-1591651', userid = '5', supplierdate = '2023-02-25 23:43:07'   WHERE supplierid = '1';
UPDATE save SET  savecurrentvalue = '285',  userid = '5' WHERE saveid = '3';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('3285.00','3000', '1', '3', 'ايصال دفع لمورد', '826', '285', '2023-02-25 23:43:07', '5',  'supplierPayedDeptController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '3000', '3000', '2023-02-25', '5', '0', '0', '2023-02-25 23:43:07','ايصال دفع لمورد ( مباشر ) ','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6331', '168', '3000', '','0');
UPDATE accountstree SET name = 'مباشر', customName = 'مباشر', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '7', mydate = '2021-12-11', itemtype2 = '1', theValue = '-1591651', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '168';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('6331', '137', '3000', '','0');
UPDATE accountstree SET name = 'خزينة رائد', customName = 'خزينة رائد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2022-07-06', itemtype2 = '1', theValue = '-845575', theOrder = '0', layingOrder = '',reportid = '0' WHERE id = '137';
UPDATE supplierdebtchange SET supplierid = '1', supplierdebtchangebefore = '-1588651.00', supplierdebtchangeamount = '3000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '451', supplierdebtchangeafter = '-1591651.00', supplierdebtchangedate = '2023-02-25 23:42:43', userid = '5', tablename = 'supplierPayedDeptController.php', comment = 'جمعبه اودي', dailyentryid = '6331',saveid = '3',currencyId='1',conversionFactor='1',payedInCurrency='1',saveConversionFactor='1' WHERE supplierdebtchangeid = '826';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 20:13:08";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 23:43:08", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('supplierPayedDeptController.php', '2023-02-25 23:43:08', '5', 'sucess', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 20:13:09";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 23:43:09", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('supplierPayedDeptController.php', '2023-02-25 23:43:09', '5', 'show', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 20:13:10";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 23:43:10", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('supplierReportsController.php', '2023-02-25 23:43:10', '5', '', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 20:13:18";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 23:43:18", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 23:43:18', '5', '', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-02-25 20:13:23";
UPDATE user SET loginip = "154.180.143.12", lastactivetime = "2023-02-25 23:43:23", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-02-25 23:43:23', '5', 'showDetail', '154.180.143.12', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 5;
