UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 05:50:10";
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-10-19 05:50:15";
UPDATE user SET loginip = "156.206.117.40", lastactivetime = "2023-10-19 09:20:15", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-10-19 09:20:15', '4', '', '156.206.117.40', '', '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-10-19',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 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-10-19',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-10-19 05:50: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-10-19 05:51:09";
UPDATE user SET loginip = "156.206.117.40", lastactivetime = "2023-10-19 09:21:09", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-10-19 09:21:09', '4', 'addsellBill', '156.206.117.40', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 09:34:11";
UPDATE user SET loginip = "156.206.1.193", lastactivetime = "2023-10-19 13:04:11", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-10-19 13:04:11', '4', 'addsellBill', '156.206.1.193', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 11:35:07";
UPDATE user SET loginip = "156.206.1.193", lastactivetime = "2023-10-19 15:05:07", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-10-19 15:05:07', '4', 'addsellBill', '156.206.1.193', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 12:19:16";
UPDATE user SET loginip = "156.206.1.193", lastactivetime = "2023-10-19 15:49:16", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-10-19 15:49:16', '4', 'addsellBill', '156.206.1.193', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 12:19:26";
UPDATE user SET loginip = "156.206.1.193", lastactivetime = "2023-10-19 15:49:26", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-10-19 15:49:26', '4', '', '156.206.1.193', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 12:19:27";
UPDATE user SET loginip = "156.206.1.193", lastactivetime = "2023-10-19 15:49:27", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-10-19 15:49:27', '4', '', '156.206.1.193', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 12:20:13";
UPDATE user SET loginip = "156.206.1.193", lastactivetime = "2023-10-19 15:50:13", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-10-19 15:50:13', '4', 'addsellBill', '156.206.1.193', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 14:36:58";
UPDATE user SET loginip = "156.206.1.193", lastactivetime = "2023-10-19 18:06:58", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2023-10-19 18:06:58', '4', '', '156.206.1.193', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 14:37:03";
UPDATE user SET loginip = "156.206.1.193", lastactivetime = "2023-10-19 18:07:03", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-10-19 18:07:03', '4', 'addsellBill', '156.206.1.193', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 14:37:03";
UPDATE user SET loginip = "156.206.1.193", lastactivetime = "2023-10-19 18:07:03", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-10-19 18:07:03', '4', 'addsellBill', '156.206.1.193', '', '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-10-19 16:34:52";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:04:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2023-10-19 20:04:53', '1', '', '156.210.55.167', '', '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-10-19 16:34:53";
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-10-19 16:35:33";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:05:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2023-10-19 20:05:33', '1', 'show', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 16:36:36";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:06:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2023-10-19 20:06:36', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 16:39:58";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:09:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:09:58', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 16:43:57";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:13:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2023-10-19 20:13:57', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 16:57:44";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:27:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2023-10-19 20:27:44', '1', 'add', '156.210.55.167', '', 'DESKTOP');
BEGIN;
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('105 هديه','','1','505','525', '565','545', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '505','505','505','505','505','0','3.96','7.92','11.88','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '105 هديه', productDescription = '', productCatId = '1', productBuyPrice = '505', productSellAllPrice = '525', productSellUnitPrice = '565', productSellHalfPrice = '545', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01467',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '505',lastbuyprice_withDiscount = '505',meanbuyprice = '505',meanbuyprice_withDiscount = '505' , productbuypricereal = '505' , buypricereal_precentage = '0' , buytotal_precentage = '3.96' , buyhalf_precentage = '7.92' , buypart_precentage = '11.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1467';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1467', '1', '2023-10-19', '1', '0','0146701','525','545','565','505');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1467', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '16', '0', '1467', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1467, 1,'2023-10-19 20:27:44',1)
                ON DUPLICATE KEY UPDATE productid = 1467, edited = 1, sysdate = '2023-10-19 20:27:44', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8080', '8080', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:44','إضافة منتج 105 هديه الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8618', '19', '8080', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14696095.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8618', '7', '8080', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15454376.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '105 هديه', productDescription = '', productCatId = '1', productBuyPrice = '505.00', productSellAllPrice = '525.00', productSellUnitPrice = '565.00', productSellHalfPrice = '545.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01467',type ='0', expireDate = '0' , dailyentryId = '8618',isService = '0',isOptic = '0',lastbuyprice = '505',lastbuyprice_withDiscount = '505',meanbuyprice = '505',meanbuyprice_withDiscount = '505' , productbuypricereal = '505' , buypricereal_precentage = '0' , buytotal_precentage = '3.96' , buyhalf_precentage = '7.92' , buypart_precentage = '11.88',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1467';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('110 هديه','','1','525','545', '585','565', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '525','525','525','525','525','0','3.81','7.62','11.43','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '110 هديه', productDescription = '', productCatId = '1', productBuyPrice = '525', productSellAllPrice = '545', productSellUnitPrice = '585', productSellHalfPrice = '565', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01468',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '525',lastbuyprice_withDiscount = '525',meanbuyprice = '525',meanbuyprice_withDiscount = '525' , productbuypricereal = '525' , buypricereal_precentage = '0' , buytotal_precentage = '3.81' , buyhalf_precentage = '7.62' , buypart_precentage = '11.43',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1468';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1468', '1', '2023-10-19', '1', '0','0146801','545','565','585','525');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1468', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1468', '1', '16', '0', '1468', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1468, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1468, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8400', '8400', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 110 هديه الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8619', '19', '8400', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14704495.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8619', '7', '8400', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15462776.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '110 هديه', productDescription = '', productCatId = '1', productBuyPrice = '525.00', productSellAllPrice = '545.00', productSellUnitPrice = '585.00', productSellHalfPrice = '565.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01468',type ='0', expireDate = '0' , dailyentryId = '8619',isService = '0',isOptic = '0',lastbuyprice = '525',lastbuyprice_withDiscount = '525',meanbuyprice = '525',meanbuyprice_withDiscount = '525' , productbuypricereal = '525' , buypricereal_precentage = '0' , buytotal_precentage = '3.81' , buyhalf_precentage = '7.62' , buypart_precentage = '11.43',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1468';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('115 هديه','','1','520','540', '580','560', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '520','520','520','520','520','0','3.85','7.69','11.54','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '115 هديه', productDescription = '', productCatId = '1', productBuyPrice = '520', productSellAllPrice = '540', productSellUnitPrice = '580', productSellHalfPrice = '560', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01469',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '520',lastbuyprice_withDiscount = '520',meanbuyprice = '520',meanbuyprice_withDiscount = '520' , productbuypricereal = '520' , buypricereal_precentage = '0' , buytotal_precentage = '3.85' , buyhalf_precentage = '7.69' , buypart_precentage = '11.54',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1469';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1469', '1', '2023-10-19', '1', '0','0146901','540','560','580','520');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1469', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1469', '1', '16', '0', '1469', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1469, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1469, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8320', '8320', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 115 هديه الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8620', '19', '8320', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14712815.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8620', '7', '8320', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15471096.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '115 هديه', productDescription = '', productCatId = '1', productBuyPrice = '520.00', productSellAllPrice = '540.00', productSellUnitPrice = '580.00', productSellHalfPrice = '560.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01469',type ='0', expireDate = '0' , dailyentryId = '8620',isService = '0',isOptic = '0',lastbuyprice = '520',lastbuyprice_withDiscount = '520',meanbuyprice = '520',meanbuyprice_withDiscount = '520' , productbuypricereal = '520' , buypricereal_precentage = '0' , buytotal_precentage = '3.85' , buyhalf_precentage = '7.69' , buypart_precentage = '11.54',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1469';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('120 هديه','','1','540','560', '600','580', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '540','540','540','540','540','0','3.7','7.41','11.11','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '120 هديه', productDescription = '', productCatId = '1', productBuyPrice = '540', productSellAllPrice = '560', productSellUnitPrice = '600', productSellHalfPrice = '580', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01470',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '540',lastbuyprice_withDiscount = '540',meanbuyprice = '540',meanbuyprice_withDiscount = '540' , productbuypricereal = '540' , buypricereal_precentage = '0' , buytotal_precentage = '3.7' , buyhalf_precentage = '7.41' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1470';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1470', '1', '2023-10-19', '1', '0','0147001','560','580','600','540');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1470', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1470', '1', '16', '0', '1470', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1470, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1470, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8640', '8640', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 120 هديه الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8621', '19', '8640', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14721455.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8621', '7', '8640', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15479736.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '120 هديه', productDescription = '', productCatId = '1', productBuyPrice = '540.00', productSellAllPrice = '560.00', productSellUnitPrice = '600.00', productSellHalfPrice = '580.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01470',type ='0', expireDate = '0' , dailyentryId = '8621',isService = '0',isOptic = '0',lastbuyprice = '540',lastbuyprice_withDiscount = '540',meanbuyprice = '540',meanbuyprice_withDiscount = '540' , productbuypricereal = '540' , buypricereal_precentage = '0' , buytotal_precentage = '3.7' , buyhalf_precentage = '7.41' , buypart_precentage = '11.11',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1470';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('125 هديه','','1','535','555', '595','575', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '535','535','535','535','535','0','3.74','7.48','11.21','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '125 هديه', productDescription = '', productCatId = '1', productBuyPrice = '535', productSellAllPrice = '555', productSellUnitPrice = '595', productSellHalfPrice = '575', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01471',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '535',lastbuyprice_withDiscount = '535',meanbuyprice = '535',meanbuyprice_withDiscount = '535' , productbuypricereal = '535' , buypricereal_precentage = '0' , buytotal_precentage = '3.74' , buyhalf_precentage = '7.48' , buypart_precentage = '11.21',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1471';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1471', '1', '2023-10-19', '1', '0','0147101','555','575','595','535');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1471', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1471', '1', '16', '0', '1471', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1471, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1471, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8560', '8560', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 125 هديه الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8622', '19', '8560', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14730015.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8622', '7', '8560', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15488296.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '125 هديه', productDescription = '', productCatId = '1', productBuyPrice = '535.00', productSellAllPrice = '555.00', productSellUnitPrice = '595.00', productSellHalfPrice = '575.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01471',type ='0', expireDate = '0' , dailyentryId = '8622',isService = '0',isOptic = '0',lastbuyprice = '535',lastbuyprice_withDiscount = '535',meanbuyprice = '535',meanbuyprice_withDiscount = '535' , productbuypricereal = '535' , buypricereal_precentage = '0' , buytotal_precentage = '3.74' , buyhalf_precentage = '7.48' , buypart_precentage = '11.21',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1471';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('130 هديه','','1','560','580', '620','600', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '560','560','560','560','560','0','3.57','7.14','10.71','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '130 هديه', productDescription = '', productCatId = '1', productBuyPrice = '560', productSellAllPrice = '580', productSellUnitPrice = '620', productSellHalfPrice = '600', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01472',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '3.57' , buyhalf_precentage = '7.14' , buypart_precentage = '10.71',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1472';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1472', '1', '2023-10-19', '1', '0','0147201','580','600','620','560');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1472', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1472', '1', '16', '0', '1472', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1472, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1472, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8960', '8960', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 130 هديه الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8623', '19', '8960', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14738975.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8623', '7', '8960', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15497256.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '130 هديه', productDescription = '', productCatId = '1', productBuyPrice = '560.00', productSellAllPrice = '580.00', productSellUnitPrice = '620.00', productSellHalfPrice = '600.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01472',type ='0', expireDate = '0' , dailyentryId = '8623',isService = '0',isOptic = '0',lastbuyprice = '560',lastbuyprice_withDiscount = '560',meanbuyprice = '560',meanbuyprice_withDiscount = '560' , productbuypricereal = '560' , buypricereal_precentage = '0' , buytotal_precentage = '3.57' , buyhalf_precentage = '7.14' , buypart_precentage = '10.71',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1472';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('145 هديه','','1','500','520', '560','540', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '500','500','500','500','500','0','4','8','12','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '145 هديه', productDescription = '', productCatId = '1', productBuyPrice = '500', productSellAllPrice = '520', productSellUnitPrice = '560', productSellHalfPrice = '540', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01473',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '4' , buyhalf_precentage = '8' , buypart_precentage = '12',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1473';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1473', '1', '2023-10-19', '1', '0','0147301','520','540','560','500');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1473', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1473', '1', '16', '0', '1473', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1473, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1473, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8000', '8000', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 145 هديه الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8624', '19', '8000', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14746975.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8624', '7', '8000', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15505256.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '145 هديه', productDescription = '', productCatId = '1', productBuyPrice = '500.00', productSellAllPrice = '520.00', productSellUnitPrice = '560.00', productSellHalfPrice = '540.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01473',type ='0', expireDate = '0' , dailyentryId = '8624',isService = '0',isOptic = '0',lastbuyprice = '500',lastbuyprice_withDiscount = '500',meanbuyprice = '500',meanbuyprice_withDiscount = '500' , productbuypricereal = '500' , buypricereal_precentage = '0' , buytotal_precentage = '4' , buyhalf_precentage = '8' , buypart_precentage = '12',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1473';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('200 سندريلا','','1','470','490', '530','510', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '470','470','470','470','470','0','4.26','8.51','12.77','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '200 سندريلا', productDescription = '', productCatId = '1', productBuyPrice = '470', productSellAllPrice = '490', productSellUnitPrice = '530', productSellHalfPrice = '510', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01474',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '4.26' , buyhalf_precentage = '8.51' , buypart_precentage = '12.77',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1474';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1474', '1', '2023-10-19', '1', '0','0147401','490','510','530','470');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1474', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1474', '1', '16', '0', '1474', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1474, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1474, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '7520', '7520', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 200 سندريلا الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8625', '19', '7520', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14754495.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8625', '7', '7520', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15512776.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '200 سندريلا', productDescription = '', productCatId = '1', productBuyPrice = '470.00', productSellAllPrice = '490.00', productSellUnitPrice = '530.00', productSellHalfPrice = '510.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01474',type ='0', expireDate = '0' , dailyentryId = '8625',isService = '0',isOptic = '0',lastbuyprice = '470',lastbuyprice_withDiscount = '470',meanbuyprice = '470',meanbuyprice_withDiscount = '470' , productbuypricereal = '470' , buypricereal_precentage = '0' , buytotal_precentage = '4.26' , buyhalf_precentage = '8.51' , buypart_precentage = '12.77',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1474';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('202 سندريلا','','1','555','575', '615','595', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '555','555','555','555','555','0','3.6','7.21','10.81','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '202 سندريلا', productDescription = '', productCatId = '1', productBuyPrice = '555', productSellAllPrice = '575', productSellUnitPrice = '615', productSellHalfPrice = '595', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01475',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '555',lastbuyprice_withDiscount = '555',meanbuyprice = '555',meanbuyprice_withDiscount = '555' , productbuypricereal = '555' , buypricereal_precentage = '0' , buytotal_precentage = '3.6' , buyhalf_precentage = '7.21' , buypart_precentage = '10.81',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1475';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1475', '1', '2023-10-19', '1', '0','0147501','575','595','615','555');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1475', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1475', '1', '16', '0', '1475', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1475, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1475, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8880', '8880', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 202 سندريلا الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8626', '19', '8880', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14763375.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8626', '7', '8880', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15521656.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '202 سندريلا', productDescription = '', productCatId = '1', productBuyPrice = '555.00', productSellAllPrice = '575.00', productSellUnitPrice = '615.00', productSellHalfPrice = '595.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01475',type ='0', expireDate = '0' , dailyentryId = '8626',isService = '0',isOptic = '0',lastbuyprice = '555',lastbuyprice_withDiscount = '555',meanbuyprice = '555',meanbuyprice_withDiscount = '555' , productbuypricereal = '555' , buypricereal_precentage = '0' , buytotal_precentage = '3.6' , buyhalf_precentage = '7.21' , buypart_precentage = '10.81',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1475';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('203سندريلا','','1','515','535', '575','555', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '515','515','515','515','515','0','3.88','7.77','11.65','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '203سندريلا', productDescription = '', productCatId = '1', productBuyPrice = '515', productSellAllPrice = '535', productSellUnitPrice = '575', productSellHalfPrice = '555', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01476',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '515',lastbuyprice_withDiscount = '515',meanbuyprice = '515',meanbuyprice_withDiscount = '515' , productbuypricereal = '515' , buypricereal_precentage = '0' , buytotal_precentage = '3.88' , buyhalf_precentage = '7.77' , buypart_precentage = '11.65',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1476';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1476', '1', '2023-10-19', '1', '0','0147601','535','555','575','515');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1476', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1476', '1', '16', '0', '1476', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1476, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1476, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8240', '8240', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 203سندريلا الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8627', '19', '8240', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14771615.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8627', '7', '8240', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15529896.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '203سندريلا', productDescription = '', productCatId = '1', productBuyPrice = '515.00', productSellAllPrice = '535.00', productSellUnitPrice = '575.00', productSellHalfPrice = '555.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01476',type ='0', expireDate = '0' , dailyentryId = '8627',isService = '0',isOptic = '0',lastbuyprice = '515',lastbuyprice_withDiscount = '515',meanbuyprice = '515',meanbuyprice_withDiscount = '515' , productbuypricereal = '515' , buypricereal_precentage = '0' , buytotal_precentage = '3.88' , buyhalf_precentage = '7.77' , buypart_precentage = '11.65',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1476';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('205سندريلا','','1','525','545', '585','565', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '525','525','525','525','525','0','3.81','7.62','11.43','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '205سندريلا', productDescription = '', productCatId = '1', productBuyPrice = '525', productSellAllPrice = '545', productSellUnitPrice = '585', productSellHalfPrice = '565', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01477',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '525',lastbuyprice_withDiscount = '525',meanbuyprice = '525',meanbuyprice_withDiscount = '525' , productbuypricereal = '525' , buypricereal_precentage = '0' , buytotal_precentage = '3.81' , buyhalf_precentage = '7.62' , buypart_precentage = '11.43',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1477';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1477', '1', '2023-10-19', '1', '0','0147701','545','565','585','525');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1477', '1', '20', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1477', '1', '20', '0', '1477', 'إضافة منتج', 'productController.php', '0', '20', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1477, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1477, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '10500', '10500', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 205سندريلا الكمية 20','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8628', '19', '10500', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14782115.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8628', '7', '10500', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15540396.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '205سندريلا', productDescription = '', productCatId = '1', productBuyPrice = '525.00', productSellAllPrice = '545.00', productSellUnitPrice = '585.00', productSellHalfPrice = '565.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01477',type ='0', expireDate = '0' , dailyentryId = '8628',isService = '0',isOptic = '0',lastbuyprice = '525',lastbuyprice_withDiscount = '525',meanbuyprice = '525',meanbuyprice_withDiscount = '525' , productbuypricereal = '525' , buypricereal_precentage = '0' , buytotal_precentage = '3.81' , buyhalf_precentage = '7.62' , buypart_precentage = '11.43',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1477';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('206سندريلا','','1','510','530', '570','550', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '510','510','510','510','510','0','3.92','7.84','11.76','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '206سندريلا', productDescription = '', productCatId = '1', productBuyPrice = '510', productSellAllPrice = '530', productSellUnitPrice = '570', productSellHalfPrice = '550', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01478',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '510',meanbuyprice_withDiscount = '510' , productbuypricereal = '510' , buypricereal_precentage = '0' , buytotal_precentage = '3.92' , buyhalf_precentage = '7.84' , buypart_precentage = '11.76',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1478';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1478', '1', '2023-10-19', '1', '0','0147801','530','550','570','510');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1478', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1478', '1', '16', '0', '1478', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1478, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1478, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8160', '8160', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 206سندريلا الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8629', '19', '8160', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14790275.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8629', '7', '8160', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15548556.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '206سندريلا', productDescription = '', productCatId = '1', productBuyPrice = '510.00', productSellAllPrice = '530.00', productSellUnitPrice = '570.00', productSellHalfPrice = '550.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01478',type ='0', expireDate = '0' , dailyentryId = '8629',isService = '0',isOptic = '0',lastbuyprice = '510',lastbuyprice_withDiscount = '510',meanbuyprice = '510',meanbuyprice_withDiscount = '510' , productbuypricereal = '510' , buypricereal_precentage = '0' , buytotal_precentage = '3.92' , buyhalf_precentage = '7.84' , buypart_precentage = '11.76',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1478';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('207سندرلا','','1','550','570', '610','590', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '550','550','550','550','550','0','3.64','7.27','10.91','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '207سندرلا', productDescription = '', productCatId = '1', productBuyPrice = '550', productSellAllPrice = '570', productSellUnitPrice = '610', productSellHalfPrice = '590', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01479',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550' , buypricereal_precentage = '0' , buytotal_precentage = '3.64' , buyhalf_precentage = '7.27' , buypart_precentage = '10.91',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1479';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1479', '1', '2023-10-19', '1', '0','0147901','570','590','610','550');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1479', '1', '16', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1479', '1', '16', '0', '1479', 'إضافة منتج', 'productController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1479, 1,'2023-10-19 20:27:45',1)
                ON DUPLICATE KEY UPDATE productid = 1479, edited = 1, sysdate = '2023-10-19 20:27:45', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '8800', '8800', '2023-10-19', '1', '0', '0', '2023-10-19 20:27:45','إضافة منتج 207سندرلا الكمية 16','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8630', '19', '8800', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14799075.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8630', '7', '8800', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15557356.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '207سندرلا', productDescription = '', productCatId = '1', productBuyPrice = '550.00', productSellAllPrice = '570.00', productSellUnitPrice = '610.00', productSellHalfPrice = '590.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01479',type ='0', expireDate = '0' , dailyentryId = '8630',isService = '0',isOptic = '0',lastbuyprice = '550',lastbuyprice_withDiscount = '550',meanbuyprice = '550',meanbuyprice_withDiscount = '550' , productbuypricereal = '550' , buypricereal_precentage = '0' , buytotal_precentage = '3.64' , buyhalf_precentage = '7.27' , buypart_precentage = '10.91',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1479';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 16:57:47";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:27:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2023-10-19 20:27:47', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 16:57:50";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:27:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:27:50', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:00:39";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:30:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:30:39', '1', 'add', '156.210.55.167', '', '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(1706,1,6,1467,16,'2023-10-19',1,0, '' ,0,0,0,0,0,'2023-10-19 20:30:39',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5392';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1467, 0, 0
                    , 505.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 505.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*505.00," WHERE transferproductid = 7484;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '16', '1', '7484', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1467', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1467, 0, 0
                    , 505.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '6', '16', '0', '7484', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1468', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5393';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1468, 0, 0
                    , 525.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 525.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*525.00," WHERE transferproductid = 7485;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1468', '1', '16', '1', '7485', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1468', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1468, 0, 0
                    , 525.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1468', '6', '16', '0', '7485', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1469', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5394';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1469, 0, 0
                    , 520.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 520.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*520.00," WHERE transferproductid = 7486;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1469', '1', '16', '1', '7486', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1469', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1469, 0, 0
                    , 520.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1469', '6', '16', '0', '7486', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1470', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5395';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1470, 0, 0
                    , 540.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 540.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*540.00," WHERE transferproductid = 7487;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1470', '1', '16', '1', '7487', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1470', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1470, 0, 0
                    , 540.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1470', '6', '16', '0', '7487', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1471', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5396';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1471, 0, 0
                    , 535.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 535.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*535.00," WHERE transferproductid = 7488;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1471', '1', '16', '1', '7488', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1471', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1471, 0, 0
                    , 535.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1471', '6', '16', '0', '7488', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1472', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5397';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1472, 0, 0
                    , 560.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 560.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*560.00," WHERE transferproductid = 7489;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1472', '1', '16', '1', '7489', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1472', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1472, 0, 0
                    , 560.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1472', '6', '16', '0', '7489', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1473', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5398';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1473, 0, 0
                    , 500.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 500.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*500.00," WHERE transferproductid = 7490;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1473', '1', '16', '1', '7490', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1473', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1473, 0, 0
                    , 500.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1473', '6', '16', '0', '7490', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1474', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5399';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1474, 0, 0
                    , 470.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 470.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*470.00," WHERE transferproductid = 7491;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1474', '1', '16', '1', '7491', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1474', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1474, 0, 0
                    , 470.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1474', '6', '16', '0', '7491', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1475', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5400';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1475, 0, 0
                    , 555.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 555.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*555.00," WHERE transferproductid = 7492;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1475', '1', '16', '1', '7492', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1475', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1475, 0, 0
                    , 555.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1475', '6', '16', '0', '7492', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1476', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5401';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1476, 0, 0
                    , 515.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 515.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*515.00," WHERE transferproductid = 7493;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1476', '1', '16', '1', '7493', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1476', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1476, 0, 0
                    , 515.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1476', '6', '16', '0', '7493', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1477', '20', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5402';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1477, 0, 0
                    , 525.00, -20, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 525.00,
                        buyQuantity =buyQuantity+-20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "20*2023-10-19*525.00," WHERE transferproductid = 7494;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1477', '1', '20', '1', '7494', 'تحويل منتجات من المخزن', 'storemovementController.php', '20.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1477', '6', '20', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1477, 0, 0
                    , 525.00, 20, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+20, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1477', '6', '20', '0', '7494', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '20', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1478', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5403';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1478, 0, 0
                    , 510.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 510.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*510.00," WHERE transferproductid = 7495;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1478', '1', '16', '1', '7495', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1478', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1478, 0, 0
                    , 510.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1478', '6', '16', '0', '7495', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '6', '1479', '16', '2023-10-19', '1', '0','1706',null,null,'2023-10-19 20:30:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5404';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1479, 0, 0
                    , 550.00, -16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyprice = 550.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*550.00," WHERE transferproductid = 7496;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1479', '1', '16', '1', '7496', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1479', '6', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 6, 1479, 0, 0
                    , 550.00, 16, 0, 0, 1, '2023-10-19 20:30:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:30:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1479', '6', '16', '0', '7496', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:00:40";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:30:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:30:40', '1', 'editshow', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:00:54";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:30:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:30:54', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:01:12";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:31:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-10-19 20:31:12', '1', 'show', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:01:25";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:31:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-10-19 20:31:25', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:01:50";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:31:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-10-19 20:31:50', '1', 'add', '156.210.55.167', '', 'DESKTOP');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment) VALUES ('7','9', '7000.00', '2023-10-19', '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 ('7000.00','7000.00', '1', '7', 'تحويل امول الى الخزنة  [ الشيخ وليد ] ', '649', '0', '2023-10-19 20:31:50', '1',  'transfermoneyController.php','0','');
UPDATE save SET  savecurrentvalue = '7611090',  userid = '1' WHERE saveid = '9';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('7604090.00','7000.00', '0', '9', 'تحويل امول من الخزنة  [ خزينة محل العميد ] ', '649', '7611090', '2023-10-19 20:31:50', '1',  'transfermoneyController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '7000', '7000', '2023-10-19', '1', '0', '0', '2023-10-19 20:31:50','اضافة تحويل من خزينة محل العميد الى الشيخ وليد','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8631', '156', '7000.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 = '7611090', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '156';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8631', '141', '7000.00', '','0');
UPDATE accountstree SET name = 'خزينة محل العميد', customName = 'خزينة محل العميد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1649367', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '141';
UPDATE transfermoney SET saveidfrom = '7', saveidto = '9', transfermoneyvalue = '7000.00', transfermoneydate = '2023-10-19', userid = '1', conditions = '0' , dailyentryid = '8631' , comment = '' WHERE transfermoneyid = '649';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:01:51";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:31:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-10-19 20:31:51', '1', 'sucess', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:01:52";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:31:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-10-19 20:31:53', '1', 'show', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:01:58";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:31:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-10-19 20:31:58', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:02:11";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:32:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-10-19 20:32:11', '1', 'add', '156.210.55.167', '', 'DESKTOP');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment) VALUES ('8','9', '16555.00', '2023-10-19', '1', '0', '0','');
UPDATE save SET  savecurrentvalue = '0',  userid = '1' WHERE saveid = '8';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('16555.00','16555.00', '1', '8', 'تحويل امول الى الخزنة  [ الشيخ وليد ] ', '650', '0', '2023-10-19 20:32:11', '1',  'transfermoneyController.php','0','');
UPDATE save SET  savecurrentvalue = '7627645',  userid = '1' WHERE saveid = '9';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('7611090.00','16555.00', '0', '9', 'تحويل امول من الخزنة  [ خزينة محل ابو كريم ] ', '650', '7627645', '2023-10-19 20:32:11', '1',  'transfermoneyController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '16555', '16555', '2023-10-19', '1', '0', '0', '2023-10-19 20:32:11','اضافة تحويل من خزينة محل ابو كريم الى الشيخ وليد','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8632', '156', '16555.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 = '7627645', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '156';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8632', '142', '16555.00', '','0');
UPDATE accountstree SET name = 'خزينة محل ابو كريم', customName = 'خزينة محل ابو كريم', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-1809401', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '142';
UPDATE transfermoney SET saveidfrom = '8', saveidto = '9', transfermoneyvalue = '16555.00', transfermoneydate = '2023-10-19', userid = '1', conditions = '0' , dailyentryid = '8632' , comment = '' WHERE transfermoneyid = '650';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:02:12";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:32:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-10-19 20:32:12', '1', 'sucess', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:02:14";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:32:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2023-10-19 20:32:14', '1', 'show', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:02:23";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:32:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:32:23', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:04:33";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:34:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:34:33', '1', 'add', '156.210.55.167', '', '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(1707,7,8,1459,9,'2023-10-19',1,0, '' ,0,0,0,0,0,'2023-10-19 20:34:33',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5374';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-10', 7, 1459, 0, 0
                    , 255.00, 9, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-9, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2023-10-10*255.00," WHERE transferproductid = 7497;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1459', '7', '9', '1', '7497', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '1', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1459', '8', '9', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-10', 8, 1459, 0, 0
                    , 255.00, 9, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1459', '8', '9', '0', '7497', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '9', '1', '2023-10-19','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', '8', '1458', '7', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:33',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5373';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-10', 7, 1458, 0, 0
                    , 250.00, 7, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-7, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "7*2023-10-10*250.00," WHERE transferproductid = 7498;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1458', '7', '7', '1', '7498', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '3', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1458', '8', '7', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-10', 8, 1458, 0, 0
                    , 250.00, 7, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+7, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1458', '8', '7', '0', '7498', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '7', '1', '2023-10-19','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', '8', '1402', '4', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:33',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '63', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5190';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-06-20', 7, 1402, 0, 0
                    , 320.00, 4, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-4, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2023-06-20*320.00," WHERE transferproductid = 7499;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1402', '7', '4', '1', '7499', 'تحويل منتجات من المخزن', 'storemovementController.php', '67.00', '63', '1', '2023-10-19','0','0');
UPDATE storedetail SET  productquantity = '15', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5191';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-06-20', 8, 1402, 0, 0
                    , 320.00, 4, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1402', '8', '4', '0', '7499', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '11.00', '15', '1', '2023-10-19','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', '8', '1415', '2', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:33',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5226';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 7, 1415, 0, 0
                    , 300.00, -2, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyprice = 300.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2023-10-19*300.00," WHERE transferproductid = 7500;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1415', '7', '2', '1', '7500', 'تحويل منتجات من المخزن', 'storemovementController.php', '3.00', '1', '1', '2023-10-19','0','0');
UPDATE storedetail SET  productquantity = '11', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5225';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 8, 1415, 0, 0
                    , 300.00, 2, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1415', '8', '2', '0', '7500', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '9.00', '11', '1', '2023-10-19','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', '8', '1358', '1', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:33',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5037';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 7, 1358, 0, 0
                    , 280.00, -1, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyprice = 280.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-10-19*280.00," WHERE transferproductid = 7501;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1358', '7', '1', '1', '7501', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '9', '1', '2023-10-19','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5038';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 8, 1358, 0, 0
                    , 280.00, 1, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1358', '8', '1', '0', '7501', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '2.00', '3', '1', '2023-10-19','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', '8', '1298', '2', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:33',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5165';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 7, 1298, 0, 0
                    , 230.00, -2, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyprice = 230.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2023-10-19*230.00," WHERE transferproductid = 7502;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1298', '7', '2', '1', '7502', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '7', '1', '2023-10-19','0','0');
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '4827';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 8, 1298, 0, 0
                    , 230.00, 2, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1298', '8', '2', '0', '7502', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '8.00', '10', '1', '2023-10-19','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', '8', '1418', '1', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:33',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5236';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 7, 1418, 0, 0
                    , 250.00, -1, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyprice = 250.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2023-10-19*250.00," WHERE transferproductid = 7503;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1418', '7', '1', '1', '7503', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2023-10-19','0','0');
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5235';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 8, 1418, 0, 0
                    , 250.00, 1, 0, 0, 1, '2023-10-19 20:34:33')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:33' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1418', '8', '1', '0', '7503', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '8.00', '9', '1', '2023-10-19','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', '8', '1463', '5', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:33',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5384';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-16', 7, 1463, 0, 0
                    , 310.00, 5, 0, 0, 1, '2023-10-19 20:34:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:34' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2023-10-16*310.00," WHERE transferproductid = 7504;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1463', '7', '5', '1', '7504', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '5', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1463', '8', '5', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-16', 8, 1463, 0, 0
                    , 310.00, 5, 0, 0, 1, '2023-10-19 20:34:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:34' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1463', '8', '5', '0', '7504', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '5', '1', '2023-10-19','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', '8', '1460', '5', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:34',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5381';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-16', 7, 1460, 0, 0
                    , 280.00, 5, 0, 0, 1, '2023-10-19 20:34:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:34' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2023-10-16*280.00," WHERE transferproductid = 7505;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1460', '7', '5', '1', '7505', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '5', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1460', '8', '5', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-16', 8, 1460, 0, 0
                    , 280.00, 5, 0, 0, 1, '2023-10-19 20:34:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:34' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1460', '8', '5', '0', '7505', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '5', '1', '2023-10-19','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', '8', '1461', '5', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:34',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5382';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-16', 7, 1461, 0, 0
                    , 300.00, 5, 0, 0, 1, '2023-10-19 20:34:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:34' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2023-10-16*300.00," WHERE transferproductid = 7506;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1461', '7', '5', '1', '7506', 'تحويل منتجات من المخزن', 'storemovementController.php', '12.00', '7', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1461', '8', '5', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-16', 8, 1461, 0, 0
                    , 300.00, 5, 0, 0, 1, '2023-10-19 20:34:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:34' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1461', '8', '5', '0', '7506', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '5', '1', '2023-10-19','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', '8', '1464', '5', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:34',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5385';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-16', 7, 1464, 0, 0
                    , 330.00, 5, 0, 0, 1, '2023-10-19 20:34:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:34' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2023-10-16*330.00," WHERE transferproductid = 7507;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1464', '7', '5', '1', '7507', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '3', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1464', '8', '5', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-16', 8, 1464, 0, 0
                    , 330.00, 5, 0, 0, 1, '2023-10-19 20:34:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:34' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1464', '8', '5', '0', '7507', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '5', '1', '2023-10-19','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', '8', '1462', '5', '2023-10-19', '1', '0','1707',null,null,'2023-10-19 20:34:34',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5383';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-16', 7, 1462, 0, 0
                    , 320.00, 5, 0, 0, 1, '2023-10-19 20:34:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-5, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:34' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2023-10-16*320.00," WHERE transferproductid = 7508;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '7', '5', '1', '7508', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '4', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1462', '8', '5', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-16', 8, 1462, 0, 0
                    , 320.00, 5, 0, 0, 1, '2023-10-19 20:34:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:34:34' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '8', '5', '0', '7508', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '5', '1', '2023-10-19','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:04:34";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:34:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:34:34', '1', 'editshow', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:04:48";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:34:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2023-10-19 20:34:48', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:10:36";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:40:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2023-10-19 20:40:36', '1', 'add', '156.210.55.167', '', 'DESKTOP');
BEGIN;
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('2032 اشركه','','1','290','310', '350','330', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '290','290','290','290','290','0','6.9','13.79','20.69','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '2032 اشركه', productDescription = '', productCatId = '1', productBuyPrice = '290', productSellAllPrice = '310', productSellUnitPrice = '350', productSellHalfPrice = '330', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01480',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290' , buypricereal_precentage = '0' , buytotal_precentage = '6.9' , buyhalf_precentage = '13.79' , buypart_precentage = '20.69',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1480';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1480', '1', '2023-10-19', '1', '0','0148001','310','330','350','290');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1480', '1', '20', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1480', '1', '20', '0', '1480', 'إضافة منتج', 'productController.php', '0', '20', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1480, 1,'2023-10-19 20:40:36',1)
                ON DUPLICATE KEY UPDATE productid = 1480, edited = 1, sysdate = '2023-10-19 20:40:36', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '5800', '5800', '2023-10-19', '1', '0', '0', '2023-10-19 20:40:36','إضافة منتج 2032 اشركه الكمية 20','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8633', '19', '5800', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14804875.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8633', '7', '5800', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15563156.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '2032 اشركه', productDescription = '', productCatId = '1', productBuyPrice = '290.00', productSellAllPrice = '310.00', productSellUnitPrice = '350.00', productSellHalfPrice = '330.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01480',type ='0', expireDate = '0' , dailyentryId = '8633',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290' , buypricereal_precentage = '0' , buytotal_precentage = '6.9' , buyhalf_precentage = '13.79' , buypart_precentage = '20.69',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1480';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('2030 الشركه','','1','290','310', '350','330', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '290','290','290','290','290','0','6.9','13.79','20.69','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '2030 الشركه', productDescription = '', productCatId = '1', productBuyPrice = '290', productSellAllPrice = '310', productSellUnitPrice = '350', productSellHalfPrice = '330', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01481',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290' , buypricereal_precentage = '0' , buytotal_precentage = '6.9' , buyhalf_precentage = '13.79' , buypart_precentage = '20.69',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1481';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1481', '1', '2023-10-19', '1', '0','0148101','310','330','350','290');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1481', '1', '20', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1481', '1', '20', '0', '1481', 'إضافة منتج', 'productController.php', '0', '20', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1481, 1,'2023-10-19 20:40:36',1)
                ON DUPLICATE KEY UPDATE productid = 1481, edited = 1, sysdate = '2023-10-19 20:40:36', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '5800', '5800', '2023-10-19', '1', '0', '0', '2023-10-19 20:40:36','إضافة منتج 2030 الشركه الكمية 20','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8634', '19', '5800', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14810675.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8634', '7', '5800', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15568956.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '2030 الشركه', productDescription = '', productCatId = '1', productBuyPrice = '290.00', productSellAllPrice = '310.00', productSellUnitPrice = '350.00', productSellHalfPrice = '330.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01481',type ='0', expireDate = '0' , dailyentryId = '8634',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290' , buypricereal_precentage = '0' , buytotal_precentage = '6.9' , buyhalf_precentage = '13.79' , buypart_precentage = '20.69',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1481';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('2036 الشركه','','1','290','310', '350','330', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '290','290','290','290','290','0','6.9','13.79','20.69','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '2036 الشركه', productDescription = '', productCatId = '1', productBuyPrice = '290', productSellAllPrice = '310', productSellUnitPrice = '350', productSellHalfPrice = '330', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01482',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290' , buypricereal_precentage = '0' , buytotal_precentage = '6.9' , buyhalf_precentage = '13.79' , buypart_precentage = '20.69',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1482';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1482', '1', '2023-10-19', '1', '0','0148201','310','330','350','290');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1482', '1', '12', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1482', '1', '12', '0', '1482', 'إضافة منتج', 'productController.php', '0', '12', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1482, 1,'2023-10-19 20:40:36',1)
                ON DUPLICATE KEY UPDATE productid = 1482, edited = 1, sysdate = '2023-10-19 20:40:36', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '3480', '3480', '2023-10-19', '1', '0', '0', '2023-10-19 20:40:36','إضافة منتج 2036 الشركه الكمية 12','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8635', '19', '3480', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14814155.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8635', '7', '3480', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15572436.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '2036 الشركه', productDescription = '', productCatId = '1', productBuyPrice = '290.00', productSellAllPrice = '310.00', productSellUnitPrice = '350.00', productSellHalfPrice = '330.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01482',type ='0', expireDate = '0' , dailyentryId = '8635',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290' , buypricereal_precentage = '0' , buytotal_precentage = '6.9' , buyhalf_precentage = '13.79' , buypart_precentage = '20.69',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1482';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('11 الشركه','','1','300','320', '360','340', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '300','300','300','300','300','0','6.67','13.33','20','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '11 الشركه', productDescription = '', productCatId = '1', productBuyPrice = '300', productSellAllPrice = '320', productSellUnitPrice = '360', productSellHalfPrice = '340', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01483',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '300',lastbuyprice_withDiscount = '300',meanbuyprice = '300',meanbuyprice_withDiscount = '300' , productbuypricereal = '300' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '13.33' , buypart_precentage = '20',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1483';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1483', '1', '2023-10-19', '1', '0','0148301','320','340','360','300');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1483', '1', '32', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1483', '1', '32', '0', '1483', 'إضافة منتج', 'productController.php', '0', '32', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1483, 1,'2023-10-19 20:40:36',1)
                ON DUPLICATE KEY UPDATE productid = 1483, edited = 1, sysdate = '2023-10-19 20:40:36', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '9600', '9600', '2023-10-19', '1', '0', '0', '2023-10-19 20:40:36','إضافة منتج 11 الشركه الكمية 32','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8636', '19', '9600', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14823755.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8636', '7', '9600', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15582036.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '11 الشركه', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '320.00', productSellUnitPrice = '360.00', productSellHalfPrice = '340.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01483',type ='0', expireDate = '0' , dailyentryId = '8636',isService = '0',isOptic = '0',lastbuyprice = '300',lastbuyprice_withDiscount = '300',meanbuyprice = '300',meanbuyprice_withDiscount = '300' , productbuypricereal = '300' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '13.33' , buypart_precentage = '20',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1483';
INSERT INTO product (productName, productDescription, productCatId, productBuyPrice, productSellAllPrice, productSellUnitPrice, productSellHalfPrice, productDate, conditions, userId, limitamount, parcode,type, expireDate, dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount , productbuypricereal , buypricereal_precentage , buytotal_precentage , buyhalf_precentage , buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId) VALUES ('2034 الشركه','','1','300','320', '360','340', '2023-10-19', '0', '1', '0', '', '0', '0', '0', '0', '0', '300','300','300','300','300','0','6.67','13.33','20','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '2034 الشركه', productDescription = '', productCatId = '1', productBuyPrice = '300', productSellAllPrice = '320', productSellUnitPrice = '360', productSellHalfPrice = '340', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01484',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '300',lastbuyprice_withDiscount = '300',meanbuyprice = '300',meanbuyprice_withDiscount = '300' , productbuypricereal = '300' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '13.33' , buypart_precentage = '20',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1484';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1484', '1', '2023-10-19', '1', '0','0148401','320','340','360','300');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1484', '1', '12', '1', '2023-10-19');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1484', '1', '12', '0', '1484', 'إضافة منتج', 'productController.php', '0', '12', '1', '2023-10-19','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1484, 1,'2023-10-19 20:40:36',1)
                ON DUPLICATE KEY UPDATE productid = 1484, edited = 1, sysdate = '2023-10-19 20:40:36', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '3600', '3600', '2023-10-19', '1', '0', '0', '2023-10-19 20:40:36','إضافة منتج 2034 الشركه الكمية 12','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8637', '19', '3600', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '14827355.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('8637', '7', '3600', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '15585636.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '2034 الشركه', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '320.00', productSellUnitPrice = '360.00', productSellHalfPrice = '340.00', productDate = '2023-10-19', conditions = '0', userId = '1', limitamount = '0', parcode = '01484',type ='0', expireDate = '0' , dailyentryId = '8637',isService = '0',isOptic = '0',lastbuyprice = '300',lastbuyprice_withDiscount = '300',meanbuyprice = '300',meanbuyprice_withDiscount = '300' , productbuypricereal = '300' , buypricereal_precentage = '0' , buytotal_precentage = '6.67' , buyhalf_precentage = '13.33' , buypart_precentage = '20',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1484';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:10:38";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:40:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2023-10-19 20:40:38', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:10:40";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:40:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:40:40', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:11:56";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:41:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:41:57', '1', 'add', '156.210.55.167', '', '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(1708,1,7,1480,10,'2023-10-19',1,0, '' ,0,0,0,0,0,'2023-10-19 20:41:57',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5425';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1480, 0, 0
                    , 290.00, -10, 0, 0, 1, '2023-10-19 20:41:57')
                ON DUPLICATE KEY UPDATE buyprice = 290.00,
                        buyQuantity =buyQuantity+-10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:41:57' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2023-10-19*290.00," WHERE transferproductid = 7509;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1480', '1', '10', '1', '7509', 'تحويل منتجات من المخزن', 'storemovementController.php', '20.00', '10', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1480', '7', '10', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 7, 1480, 0, 0
                    , 290.00, 10, 0, 0, 1, '2023-10-19 20:41:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:41:57' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1480', '7', '10', '0', '7509', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '10', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '7', '1481', '10', '2023-10-19', '1', '0','1708',null,null,'2023-10-19 20:41:57',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5426';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1481, 0, 0
                    , 290.00, -10, 0, 0, 1, '2023-10-19 20:41:57')
                ON DUPLICATE KEY UPDATE buyprice = 290.00,
                        buyQuantity =buyQuantity+-10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:41:57' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2023-10-19*290.00," WHERE transferproductid = 7510;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1481', '1', '10', '1', '7510', 'تحويل منتجات من المخزن', 'storemovementController.php', '20.00', '10', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1481', '7', '10', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 7, 1481, 0, 0
                    , 290.00, 10, 0, 0, 1, '2023-10-19 20:41:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:41:57' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1481', '7', '10', '0', '7510', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '10', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '7', '1482', '12', '2023-10-19', '1', '0','1708',null,null,'2023-10-19 20:41:57',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5427';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1482, 0, 0
                    , 290.00, -12, 0, 0, 1, '2023-10-19 20:41:57')
                ON DUPLICATE KEY UPDATE buyprice = 290.00,
                        buyQuantity =buyQuantity+-12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:41:57' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2023-10-19*290.00," WHERE transferproductid = 7511;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1482', '1', '12', '1', '7511', 'تحويل منتجات من المخزن', 'storemovementController.php', '12.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1482', '7', '12', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 7, 1482, 0, 0
                    , 290.00, 12, 0, 0, 1, '2023-10-19 20:41:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:41:57' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1482', '7', '12', '0', '7511', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '12', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '7', '1483', '16', '2023-10-19', '1', '0','1708',null,null,'2023-10-19 20:41:57',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '16', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5428';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1483, 0, 0
                    , 300.00, -16, 0, 0, 1, '2023-10-19 20:41:57')
                ON DUPLICATE KEY UPDATE buyprice = 300.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:41:57' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*300.00," WHERE transferproductid = 7512;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1483', '1', '16', '1', '7512', 'تحويل منتجات من المخزن', 'storemovementController.php', '32.00', '16', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1483', '7', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 7, 1483, 0, 0
                    , 300.00, 16, 0, 0, 1, '2023-10-19 20:41:57')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:41:57' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1483', '7', '16', '0', '7512', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:11:57";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:41:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:41:57', '1', 'editshow', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:12:08";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:42:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:42:08', '1', '', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:13:13";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:43:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:43:14', '1', 'add', '156.210.55.167', '', '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(1709,1,8,1484,12,'2023-10-19',1,0, '' ,0,0,0,0,0,'2023-10-19 20:43:14',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5429';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1484, 0, 0
                    , 300.00, -12, 0, 0, 1, '2023-10-19 20:43:14')
                ON DUPLICATE KEY UPDATE buyprice = 300.00,
                        buyQuantity =buyQuantity+-12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:43:14' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2023-10-19*300.00," WHERE transferproductid = 7513;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1484', '1', '12', '1', '7513', 'تحويل منتجات من المخزن', 'storemovementController.php', '12.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1484', '8', '12', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 8, 1484, 0, 0
                    , 300.00, 12, 0, 0, 1, '2023-10-19 20:43:14')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:43:14' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1484', '8', '12', '0', '7513', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '12', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '8', '1483', '16', '2023-10-19', '1', '0','1709',null,null,'2023-10-19 20:43:14',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5428';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1483, 0, 0
                    , 300.00, -16, 0, 0, 1, '2023-10-19 20:43:14')
                ON DUPLICATE KEY UPDATE buyprice = 300.00,
                        buyQuantity =buyQuantity+-16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:43:14' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "16*2023-10-19*300.00," WHERE transferproductid = 7514;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1483', '1', '16', '1', '7514', 'تحويل منتجات من المخزن', 'storemovementController.php', '16.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1483', '8', '16', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 8, 1483, 0, 0
                    , 300.00, 16, 0, 0, 1, '2023-10-19 20:43:14')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+16, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:43:14' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1483', '8', '16', '0', '7514', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '16', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '8', '1481', '10', '2023-10-19', '1', '0','1709',null,null,'2023-10-19 20:43:14',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5426';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1481, 0, 0
                    , 290.00, -10, 0, 0, 1, '2023-10-19 20:43:14')
                ON DUPLICATE KEY UPDATE buyprice = 290.00,
                        buyQuantity =buyQuantity+-10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:43:14' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2023-10-19*290.00," WHERE transferproductid = 7515;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1481', '1', '10', '1', '7515', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1481', '8', '10', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 8, 1481, 0, 0
                    , 290.00, 10, 0, 0, 1, '2023-10-19 20:43:14')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:43:14' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1481', '8', '10', '0', '7515', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '10', '1', '2023-10-19','0','0');
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid) VALUES ('1', '8', '1480', '10', '2023-10-19', '1', '0','1709',null,null,'2023-10-19 20:43:14',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2023-10-19' WHERE storedetailid = '5425';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 1, 1480, 0, 0
                    , 290.00, -10, 0, 0, 1, '2023-10-19 20:43:14')
                ON DUPLICATE KEY UPDATE buyprice = 290.00,
                        buyQuantity =buyQuantity+-10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:43:14' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2023-10-19*290.00," WHERE transferproductid = 7516;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1480', '1', '10', '1', '7516', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '0', '1', '2023-10-19','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1480', '8', '10', '1', '2023-10-19');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2023-10-19', 8, 1480, 0, 0
                    , 290.00, 10, 0, 0, 1, '2023-10-19 20:43:14')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2023-10-19 20:43:14' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1480', '8', '10', '0', '7516', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '10', '1', '2023-10-19','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:13:14";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:43:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2023-10-19 20:43:14', '1', 'editshow', '156.210.55.167', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2023-10-19 17:13:27";
UPDATE user SET loginip = "156.210.55.167", lastactivetime = "2023-10-19 20:43:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2023-10-19 20:43:27', '1', 'addsellBill', '156.210.55.167', '', 'DESKTOP');
