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;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 06:42:36";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 10:12:36", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2024-10-22 10:12:36', '8', '', '154.183.52.30', '', '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 = '2024-10-22',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 = '2024-10-22',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 < "2024-10-22 06:42:41";
DROP PROCEDURE IF EXISTS clientInUse;;

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

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

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 06:42:42";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 10:12:42", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2024-10-22 10:12:42', '8', '', '154.183.52.30', '', '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 < "2024-10-22 06:42:43";
DROP PROCEDURE IF EXISTS clientInUse;;

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

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

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 06:42:43";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 10:12:43", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2024-10-22 10:12:43', '8', '', '154.183.52.30', '', '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 < "2024-10-22 06:42:44";
DROP PROCEDURE IF EXISTS clientInUse;;

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

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

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 06:49:07";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 10:19:07", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 10:19:07', '8', 'addsellBill', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 06:49:08";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 10:19:08", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 10:19:08', '8', 'addsellBill', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 06:49:12";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 10:19:12", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 10:19:12', '8', 'addsellBill', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 06:49:12";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 10:19:12", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 10:19:12', '8', 'addsellBill', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 3;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 10:39:28";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 14:09:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2024-10-22 14:09:28', '1', '', '156.210.76.86', '', '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 < "2024-10-22 10:39:29";
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 < "2024-10-22 10:40:42";
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 10:41:25";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 14:11:26", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2024-10-22 14:11:26', '7', '', '197.192.202.225', '', '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 < "2024-10-22 10:41:26";
DROP PROCEDURE IF EXISTS clientInUse;;

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

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

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 10:42:09";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 14:12:09", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 14:12:09', '7', 'addsellBill', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 10:42:10";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 14:12:10", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 14:12:10', '7', 'addsellBill', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 10:42:11";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 14:12:11", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 14:12:11', '7', 'addsellBill', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 10:42:12";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 14:12:12", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 14:12:12', '7', 'addsellBill', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 10:42:12";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 14:12:12", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 14:12:12', '7', 'addsellBill', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 1;
UPDATE user SET loginip = "" WHERE userid = 7;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 11:45:53";
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 11:46:04";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:16:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2024-10-22 15:16:06', '1', '', '156.210.76.86', '', '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 < "2024-10-22 11:46:07";
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 < "2024-10-22 11:46:10";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:16:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:16:11', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 11:47:32";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:17:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:17:32', '1', 'add', '156.210.76.86', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

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

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

END

;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =27292
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(401,@clientdebt,@clientname);
UPDATE client SET  clientdebt = '35240' , clientdate = '2024-10-22 15:17:33', userid = '1' WHERE clientid = '401';
UPDATE client SET  inUse = 0 where clientid = 401;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('401','40240.00','5000','1','ايصال تحصيل (( قبض من عميل ))','27292', '35240', '2024-10-11  15:15:11', '1', 'clientPayedDeptController.php', '   ليد الشيخ عبد اللطيف', '5000', '0', null, '0', null, null,'', '-1','1','1','1','1');
UPDATE save SET  savecurrentvalue = '728050',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('723050.00','5000', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '27292', '728050', '2024-10-22 15:17:33', '1',  'clientPayedDeptController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '5000', '5000', '2024-10-22', '1', '0', '0', '2024-10-22 15:17:33','اضافة ايصال سداد للعميل سنتر النهار','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11172', '54', '5000', '','0');
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2018-04-21', itemtype2 = '1', theValue = '535309', theOrder = '0', layingOrder = '1221',reportid = '2' WHERE id = '54';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11172', '472', '5000', '','0');
UPDATE accountstree SET name = 'سنتر النهار', customName = 'سنتر النهار', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2024-03-07', itemtype2 = '1', theValue = '-99000', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '472';
UPDATE clientdebtchange SET clientid = '401', clientdebtchangebefore = '40240.00', clientdebtchangeamount = '5000.00', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '27292', clientdebtchangeafter = '35240.00', clientdebtchangedate = '2024-10-11 15:15:11', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ليد الشيخ عبد اللطيف', totalOperationCost = '5000.00',discount='', reciptid=null, dailyentryid = '11172',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1',saveConversionFactor='1' WHERE clientdebtchangeid = '27292';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 11:47:34";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:17:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:17:35', '1', 'editprint2', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 11:48:35";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:18:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:18:35', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 11:51:38";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:21:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2024-10-22 15:21:39', '1', 'all', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 11:51:52";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:21:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2024-10-22 15:21:52', '1', 'all', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 11:57:29";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:27:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 15:27:30', '1', 'addsellBill', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:00:16";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:30:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2024-10-22 15:30:17', '1', 'all', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:00:17";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:30:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2024-10-22 15:30:17', '1', 'all', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:00:55";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:30:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2024-10-22 15:30:55', '1', 'all', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:02:12";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:32:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:32:12', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:02:12";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:32:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:32:12', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:03:01";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:33:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2024-10-22 15:33:01', '1', 'all', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:03:19";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:33:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:33:19', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:03:48";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:33:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientReportsController.php', '2024-10-22 15:33:48', '1', 'all', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:04:10";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:34:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:34:10', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:04:10";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:34:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:34:10', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:05:10";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:35:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:35:10', '1', 'add', '156.210.76.86', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

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

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

END

;

-- ----------------------------------------------------------------------------------------------------
-- clientPayedDeptController add - with modelid =27293
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(424,@clientdebt,@clientname);
UPDATE client SET  clientdebt = '11200' , clientdate = '2024-10-22 15:35:10', userid = '1' WHERE clientid = '424';
UPDATE client SET  inUse = 0 where clientid = 424;
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('424','14200.00','3000','1','ايصال تحصيل (( قبض من عميل ))','27293', '11200', '2024-10-11  16:30:10', '1', 'clientPayedDeptController.php', '   ليد الشيخ عبد اللطيف', '3000', '0', null, '0', null, null,'', '-1','1','1','1','1');
UPDATE save SET  savecurrentvalue = '731050',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('728050.00','3000', '0', '1', 'ايصال تحصيل (( قبض من عميل ))', '27293', '731050', '2024-10-22 15:35:10', '1',  'clientPayedDeptController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '3000', '3000', '2024-10-22', '1', '0', '0', '2024-10-22 15:35:10','اضافة ايصال سداد للعميل سنتر ابو عبداللة(المحلة)','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11173', '54', '3000', '','0');
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2018-04-21', itemtype2 = '1', theValue = '538309', theOrder = '0', layingOrder = '1221',reportid = '2' WHERE id = '54';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11173', '494', '3000', '','0');
UPDATE accountstree SET name = 'سنتر ابو عبداللة(المحلة)', customName = 'سنتر ابو عبداللة(المحلة)', parent = '23', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2024-08-08', itemtype2 = '1', theValue = '-8000', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '494';
UPDATE clientdebtchange SET clientid = '424', clientdebtchangebefore = '14200.00', clientdebtchangeamount = '3000.00', clientdebtchangetype = '1', processname = 'ايصال تحصيل (( قبض من عميل ))', clientdebtchangemodelid = '27293', clientdebtchangeafter = '11200.00', clientdebtchangedate = '2024-10-11 16:30:10', userid = '1', tablename = 'clientPayedDeptController.php', comment = '   ليد الشيخ عبد اللطيف', totalOperationCost = '3000.00',discount='', reciptid=null, dailyentryid = '11173',seller = '0',currencyId='1',conversionFactor='1',payedInCurrency='1',saveConversionFactor='1' WHERE clientdebtchangeid = '27293';
COMMIT;

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

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:05:10";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 15:35:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('clientPayedDeptController.php', '2024-10-22 15:35:10', '1', 'editprint2', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:30:33";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 16:00:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 16:00:34', '1', 'addsellBill', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:43:35";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 16:13:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 16:13:35', '1', 'addsellBill', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:53:37";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 16:23:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 16:23:37', '1', 'addAndRetuen', '156.210.76.86', '', 'DESKTOP');
DROP PROCEDURE IF EXISTS clientInUse;;

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

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

END

;

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06717a50017fc5
-- ----------------------------------------------------------------------------------------------------

BEGIN;
CALL clientInUse(401,@clientdebt,@clientname);
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal) VALUES ('2024-10-22 16:13:36', '06717a50017fc5', '401', '35240.00', '6555', '0', '1', '28685', '28685', '0', '-28685', '1', '2024-10-22 16:23:38', '', '1', '0', 'سنتر النهار','1', '1', '5', '0', 'سنتر النهار', '69', '0', '', '','','','-1','0','0','0','','0','0','0','0','0','0','0','0');
UPDATE client SET  clientdebt = '6555', userid = '1' WHERE clientid = '401';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('401','35240.00','28685','1','اضافة فاتورة مردوات مبيعات','6203', '6555', '2024-10-22 16:23:38', '1', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '28685', '0', null, '0', null, null,'', '0','1','1','28685','1');
UPDATE client SET  inUse = 0 where clientid = 401;
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('430.00', '01634', '6203', '1', '1634', '13', '430.00', '5590', '0', '', '0', '0', '1634', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 1.00 , meanbuyprice = 366.32, lastbuyprice_withDiscount = 1.00, meanbuyprice_withDiscount = 366.32
                where returnsellbilldetailid = 13366;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1634, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 5590, 5590, 13, 4762.16
                    , 13, 4762.16, 0, 0, 13)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+5590, returnSellCostBuyPrice = returnSellCostBuyPrice+5590, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+13
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+4762.16, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+13
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+4762.16
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+13;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 5590, 5590, 13, 4762.16
                    , 13, 4762.16, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+5590, returnSellCostBuyPrice = returnSellCostBuyPrice+5590, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+13
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+4762.16, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+13
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+4762.16
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '143', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '5933';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1634', '1', '13', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '130.00', '143', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('450.00', '01793', '6203', '1', '1793', '9', '450.00', '4050', '0', '', '0', '0', '1793', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 440.00
                where returnsellbilldetailid = 13367;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1793, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 4050, 4050, 3870, 3960
                    , 3870, 3960, 0, 0, 9)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+4050, returnSellCostBuyPrice = returnSellCostBuyPrice+4050, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+3870
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+3960, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+3870
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+3960
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+9;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 4050, 4050, 3870, 3960
                    , 3870, 3960, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+4050, returnSellCostBuyPrice = returnSellCostBuyPrice+4050, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+3870
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+3960, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+3870
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+3960
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '34', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '6438';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1793', '1', '9', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '25.00', '34', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('440.00', '01756', '6203', '1', '1756', '5', '460.00', '2300', '0', '', '0', '0', '1756', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
                where returnsellbilldetailid = 13368;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1756, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2300, 2200, 2200, 2200
                    , 2200, 2200, 0, 0, 5)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+2300, returnSellCostBuyPrice = returnSellCostBuyPrice+2200, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2200
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2200, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2200
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2200
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+5;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2300, 2200, 2200, 2200
                    , 2200, 2200, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+2300, returnSellCostBuyPrice = returnSellCostBuyPrice+2200, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2200
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2200, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2200
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2200
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '37', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '6305';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1756', '1', '5', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '32.00', '37', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('350.00', '01728', '6203', '1', '1728', '10', '350', '3500', '0', '', '0', '0', '1728', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
                where returnsellbilldetailid = 13369;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1728, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 3500, 3500, 3500, 3500
                    , 3500, 3500, 0, 0, 10)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+3500, returnSellCostBuyPrice = returnSellCostBuyPrice+3500, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+3500
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+3500, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+3500
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+3500
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+10;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 3500, 3500, 3500, 3500
                    , 3500, 3500, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+3500, returnSellCostBuyPrice = returnSellCostBuyPrice+3500, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+3500
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+3500, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+3500
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+3500
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '10', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '6237';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1728', '1', '10', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '0.00', '10', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('430.00', '01579', '6203', '1', '1579', '4', '430.00', '1720', '0', '', '0', '0', '1579', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
                where returnsellbilldetailid = 13370;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1579, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1720, 1720, 1720, 1720
                    , 1720, 1720, 0, 0, 4)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+1720, returnSellCostBuyPrice = returnSellCostBuyPrice+1720, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1720
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1720, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1720
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1720
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+4;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1720, 1720, 1720, 1720
                    , 1720, 1720, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+1720, returnSellCostBuyPrice = returnSellCostBuyPrice+1720, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1720
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1720, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1720
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1720
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '22', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '5616';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1579', '1', '4', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '18.00', '22', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('350.00', '01761', '6203', '1', '1761', '8', '350.00', '2800', '0', '', '0', '0', '1761', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
                where returnsellbilldetailid = 13371;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1761, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2800, 2800, 2800, 2800
                    , 2800, 2800, 0, 0, 8)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+2800, returnSellCostBuyPrice = returnSellCostBuyPrice+2800, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2800
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2800, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2800
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2800
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+8;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2800, 2800, 2800, 2800
                    , 2800, 2800, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+2800, returnSellCostBuyPrice = returnSellCostBuyPrice+2800, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2800
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2800, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2800
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2800
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '6340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1761', '1', '8', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '1.00', '9', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('360.00', '01698', '6203', '1', '1698', '2', '350.00', '700', '0', '', '0', '0', '1698', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 355.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 355.00
                where returnsellbilldetailid = 13372;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1698, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 700, 720, 700, 710
                    , 700, 710, 0, 0, 2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+700, returnSellCostBuyPrice = returnSellCostBuyPrice+720, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+700
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+710, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+700
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+710
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+2;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 700, 720, 700, 710
                    , 700, 710, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+700, returnSellCostBuyPrice = returnSellCostBuyPrice+720, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+700
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+710, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+700
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+710
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '6154';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1698', '1', '2', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '0.00', '2', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('430.00', '01748', '6203', '1', '1748', '1', '430', '430', '0', '', '0', '0', '1748', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 422.50, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 422.50
                where returnsellbilldetailid = 13373;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1748, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 430, 430, 430, 422.5
                    , 430, 422.5, 0, 0, 1)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+430, returnSellCostBuyPrice = returnSellCostBuyPrice+430, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+430
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+422.5, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+430
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+422.5
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 430, 430, 430, 422.5
                    , 430, 422.5, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+430, returnSellCostBuyPrice = returnSellCostBuyPrice+430, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+430
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+422.5, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+430
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+422.5
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '-4', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '6282';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1748', '1', '1', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '-5.00', '-4', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('475.00', '01786', '6203', '1', '1786', '3', '475.00', '1425', '0', '', '0', '0', '1786', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 475.00 , meanbuyprice = 475.00, lastbuyprice_withDiscount = 475.00, meanbuyprice_withDiscount = 475.00
                where returnsellbilldetailid = 13374;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1786, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1425, 1425, 1425, 1425
                    , 1425, 1425, 0, 0, 3)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+1425, returnSellCostBuyPrice = returnSellCostBuyPrice+1425, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1425
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1425, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1425
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1425
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+3;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1425, 1425, 1425, 1425
                    , 1425, 1425, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+1425, returnSellCostBuyPrice = returnSellCostBuyPrice+1425, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1425
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1425, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1425
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1425
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '103', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '6410';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1786', '1', '3', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '100.00', '103', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('430.00', '01635', '6203', '1', '1635', '3', '430.00', '1290', '0', '', '0', '0', '1635', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
                where returnsellbilldetailid = 13375;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1635, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1290, 1290, 1290, 1290
                    , 1290, 1290, 0, 0, 3)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+1290, returnSellCostBuyPrice = returnSellCostBuyPrice+1290, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1290
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1290, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1290
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1290
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+3;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1290, 1290, 1290, 1290
                    , 1290, 1290, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+1290, returnSellCostBuyPrice = returnSellCostBuyPrice+1290, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1290
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1290, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1290
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1290
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '4', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '5951';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1635', '1', '3', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '1.00', '4', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('430.00', '01781', '6203', '1', '1781', '4', '430.00', '1720', '0', '', '0', '0', '1781', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
                where returnsellbilldetailid = 13376;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1781, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1720, 1720, 1720, 1720
                    , 1720, 1720, 0, 0, 4)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+1720, returnSellCostBuyPrice = returnSellCostBuyPrice+1720, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1720
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1720, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1720
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1720
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+4;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1720, 1720, 1720, 1720
                    , 1720, 1720, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+1720, returnSellCostBuyPrice = returnSellCostBuyPrice+1720, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1720
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1720, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1720
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1720
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '-13', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '6402';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1781', '1', '4', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '-17.00', '-13', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('430.00', '01783', '6203', '1', '1783', '2', '430', '860', '0', '', '0', '0', '1783', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
                where returnsellbilldetailid = 13377;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1783, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 860, 860, 860, 860
                    , 860, 860, 0, 0, 2)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+860, returnSellCostBuyPrice = returnSellCostBuyPrice+860, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+860
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+860, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+860
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+860
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+2;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 860, 860, 860, 860
                    , 860, 860, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+860, returnSellCostBuyPrice = returnSellCostBuyPrice+860, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+860
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+860, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+860
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+860
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '6404';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1783', '1', '2', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '7.00', '9', '1', '2024-10-22 16:23:38','0','0');
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro) VALUES ('460.00', '01681', '6203', '1', '1681', '5', '460.00', '2300', '0', '', '0', '0', '1681', '0.00', '0','1','0','','','0','0','0','0','0','0');
UPDATE returnsellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
                where returnsellbilldetailid = 13378;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1681, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2300, 2300, 2300, 2300
                    , 2300, 2300, 0, 0, 5)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+2300, returnSellCostBuyPrice = returnSellCostBuyPrice+2300, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2300
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2300, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2300
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2300
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+5;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2300, 2300, 2300, 2300
                    , 2300, 2300, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+2300, returnSellCostBuyPrice = returnSellCostBuyPrice+2300, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2300
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2300, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2300
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2300
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2024-10-22 16:23:38' WHERE storedetailid = '6092';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1681', '1', '5', '0', '6203', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '2.00', '7', '1', '2024-10-22 16:23:38','0','0');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 28685, 28605, 22828, 27669.66
                    , 22828, 27669.66, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+28685, returnSellCostBuyPrice = returnSellCostBuyPrice+28605, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+22828
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+27669.66, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+22828
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+27669.66
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (401, '2024-10-22', 0, 0, 0
                    , 0, 0, 0, 0
                    , 28685, 28605, 22828, 27669.66
                    , 22828, 27669.66, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+28685, returnSellCostBuyPrice = returnSellCostBuyPrice+28605, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+22828
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+27669.66, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+22828
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+27669.66
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, -28685, -28605, -22828
                    , -27669.66, -22828, -27669.66, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-28685, netSellCostBuyPrice = netSellCostBuyPrice+-28605
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-22828
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-27669.66
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-22828
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-27669.66
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06717a50017fc5 and sellbillId = 6203 and returnsellbillId = 6203
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 12:53:38";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 16:23:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 16:23:38', '1', 'addsellBill', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 16:28:53";
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 16:28:53";
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 16:29:03";
UPDATE user SET loginip = "197.32.128.87", lastactivetime = "2024-10-22 19:59:03", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2024-10-22 19:59:03', '3', '', '197.32.128.87', '', '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 < "2024-10-22 16:29:03";
DROP PROCEDURE IF EXISTS clientInUse;;

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

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

END

;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:02:02";
UPDATE user SET loginip = "197.32.128.87", lastactivetime = "2024-10-22 20:32:02", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 20:32:02', '3', 'addsellBill', '197.32.128.87', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:05:46";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:35:46", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 20:35:46', '8', 'addsellBill', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:06:51";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:36:51", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 20:36:51', '8', 'addAndRetuen', '154.183.52.30', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06717e27316d0c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate) VALUES ('2024-10-22 20:35:47', '06717e27316d0c', '1', '0.00', '0', '10', '1', '790', '780', '780', '0', '6', '2024-10-22 20:36:51', '', '8', '0', 'نقدي', '6', '0', '3', '0', 'نقدي', '2' ,'0','','','','','-1','0','0','0','0','0','780','0','','0','0','780','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '8' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','18497', '0', '2024-10-22 20:36:51', '8', 'sellbillController.php', 'اضافة فاتورة مبيعات', '780', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 16827;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('430','01587', '18497', '1', '1587', '1', '430.00', '430', '0', '', '0', '2024-10-22 20:36:52', '1587', '0.00', '0', '6','0','','','0','0','0','0','0','0','0','0','','16827-1,');
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
                where sellbilldetailid = 54509;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1587, '2024-10-22', 424.55696202532, 430, 430
                    , 430, 430, 430, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+424.55696202532, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (6, '2024-10-22', 424.55696202532, 430, 430
                    , 430, 430, 430, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+424.55696202532, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '28', userid = '8', storedetaildate = '2024-10-22 20:36:52' WHERE storedetailid = '5650';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1587', '6', '1', '1', '18497', 'اضافة فاتورة مبيعات', 'sellbillController.php', '29.00', '28', '8', '2024-10-22 20:36:52','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 16665;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('260','01508', '18497', '1', '1508', '1', '360', '360', '0', '', '0', '2024-10-22 20:36:52', '1508', '0.00', '0', '6','0','','','0','0','0','0','0','0','0','0','','16665-1,');
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
                where sellbilldetailid = 54510;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1508, '2024-10-22', 355.44303797468, 260, 260
                    , 260, 260, 260, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+355.44303797468, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (6, '2024-10-22', 355.44303797468, 260, 260
                    , 260, 260, 260, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+355.44303797468, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '21', userid = '8', storedetaildate = '2024-10-22 20:36:52' WHERE storedetailid = '5519';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1508', '6', '1', '1', '18497', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22.00', '21', '8', '2024-10-22 20:36:52','0','0');
UPDATE save SET  savecurrentvalue = '40820',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('40040.00','780', '0', '6', 'اضافة فاتورة مبيعات', '18497', '40820', '2024-10-22 20:36:52', '8',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2024-10-22', 780, 690, 690
                    , 690, 690, 690, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+780, sellCostBuyPrice =sellCostBuyPrice+690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 780, 690, 690
                    , 690, 690, 690, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+780, sellCostBuyPrice =sellCostBuyPrice+690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 780, 690, 690
                    , 690, 690, 690, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+780, netSellCostBuyPrice = netSellCostBuyPrice+690
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+690
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+690
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+690
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+690
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06717e27316d0c and sellbillId = 18497 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:06:52";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:36:52", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 20:36:52', '8', 'addsellBill', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:06:55";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:36:55", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2024-10-22 20:36:55', '8', '', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:07:19";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:37:19", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 20:37:19', '8', '', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:07:41";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:37:41", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 20:37:41', '8', 'add', '154.183.52.30', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('-1', 'فطار', '', '20', '2024-10-22', '8', '0','-1','6','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '40800',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('40820.00','20', '1', '6', 'إضافة مصروف', '5563', '40800', '2024-10-22 20:37:41', '8',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '20', '20', '2024-10-22', '8', '0', '0', '2024-10-22 20:37:41','اضافة اسم مصروف( فطار )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11174', '160', '20', '','0');
UPDATE accountstree SET name = '', customName = '', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '1', userid = '1', mydate = '2021-12-01', itemtype2 = '1', theValue = '-4734905', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '160';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11174', '140', '20', '','0');
UPDATE accountstree SET name = 'خزينة محل كفر الدوار', customName = 'خزينة محل كفر الدوار', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-2167597', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '140';
UPDATE expenses SET expensestypeid = '-1', expensesname = 'فطار', expensesdetails = '', expensesValue = '20.00', expensesdate = '2024-10-22', userid = '8', conditions = '0',saveid = '6' , dailyentryid = '11174', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '5563';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:07:41";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:37:41", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 20:37:41', '8', 'sucess', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:07:46";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:37:46", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 20:37:46', '8', 'show', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:07:51";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:37:51", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 20:37:51', '8', '', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:08:36";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:38:36", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 20:38:36', '8', 'add', '154.183.52.30', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('-1', 'صفي نسب', '', '3000', '2024-10-22', '8', '0','-1','6','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '37800',  userid = '8' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('40800.00','3000', '1', '6', 'إضافة مصروف', '5564', '37800', '2024-10-22 20:38:36', '8',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '3000', '3000', '2024-10-22', '8', '0', '0', '2024-10-22 20:38:36','اضافة اسم مصروف( صفي نسب )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11175', '160', '3000', '','0');
UPDATE accountstree SET name = '', customName = '', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '1', userid = '1', mydate = '2021-12-01', itemtype2 = '1', theValue = '-4737905', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '160';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11175', '140', '3000', '','0');
UPDATE accountstree SET name = 'خزينة محل كفر الدوار', customName = 'خزينة محل كفر الدوار', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-2170597', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '140';
UPDATE expenses SET expensestypeid = '-1', expensesname = 'صفي نسب', expensesdetails = '', expensesValue = '3000.00', expensesdate = '2024-10-22', userid = '8', conditions = '0',saveid = '6' , dailyentryid = '11175', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '5564';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:08:36";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:38:36", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 20:38:36', '8', 'sucess', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:08:38";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:38:38", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 20:38:38', '8', 'show', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:08:40";
UPDATE user SET loginip = "154.183.52.30", lastactivetime = "2024-10-22 20:38:40", deviceType = "DESKTOP" WHERE userid = 8;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2024-10-22 20:38:40', '8', '', '154.183.52.30', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:36:51";
UPDATE user SET loginip = "197.32.128.87", lastactivetime = "2024-10-22 21:06:51", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 21:06:51', '3', 'addsellBill', '197.32.128.87', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:51:43";
UPDATE user SET loginip = "197.32.128.87", lastactivetime = "2024-10-22 21:21:43", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 21:21:43', '3', 'addAndRetuen', '197.32.128.87', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06717e9bbd0f31
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate) VALUES ('2024-10-22 21:06:51', '06717e9bbd0f31', '1', '0.00', '0', '0', '1', '4690', '4690', '4690', '0', '8', '2024-10-22 21:21:44', '', '3', '0', 'نقدي', '8', '0', '3', '0', 'نقدي', '12' ,'0','','','','','-1','0','0','0','0','0','4690','0','','0','0','4690','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '3' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','18498', '0', '2024-10-22 21:21:44', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4690', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20115;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('430','01808', '18498', '1', '1808', '1', '440', '440', '0', '', '2', '2024-10-22 21:21:44', '1808', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','20115-1,');
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
                where sellbilldetailid = 54511;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1808, '2024-10-22', 440, 430, 430
                    , 430, 430, 430, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 440, 430, 430
                    , 430, 430, 430, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '18', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '6521';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1808', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '19.00', '18', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 19699;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('280','01811', '18498', '1', '1811', '1', '340', '340', '0', '', '2', '2024-10-22 21:21:44', '1811', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','19699-1,');
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 305.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 305.00
                where sellbilldetailid = 54512;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1811, '2024-10-22', 340, 330, 280
                    , 305, 280, 305, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+305
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+305
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 340, 330, 280
                    , 305, 280, 305, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+305
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+305
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '22', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '6495';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1811', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '23.00', '22', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 17059;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('420','01576', '18498', '1', '1576', '1', '430', '430', '0', '', '2', '2024-10-22 21:21:44', '1576', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','17059-1,');
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
                where sellbilldetailid = 54513;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1576, '2024-10-22', 430, 420, 420
                    , 420, 420, 420, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 430, 420, 420
                    , 420, 420, 420, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+430, sellCostBuyPrice =sellCostBuyPrice+420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '11', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '5766';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1576', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12.00', '11', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 19577;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('250','01780', '18498', '1', '1780', '1', '310', '310', '0', '', '2', '2024-10-22 21:21:44', '1780', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','19577-1,');
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
                where sellbilldetailid = 54514;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1780, '2024-10-22', 310, 250, 250
                    , 250, 250, 250, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 310, 250, 250
                    , 250, 250, 250, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+310, sellCostBuyPrice =sellCostBuyPrice+250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '24', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '6401';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1780', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25.00', '24', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 19779;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('400','01818', '18498', '1', '1818', '1', '390', '390', '0', '', '2', '2024-10-22 21:21:44', '1818', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','19779-1,');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 390.00
                where sellbilldetailid = 54515;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1818, '2024-10-22', 390, 380, 400
                    , 390, 400, 390, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 390, 380, 400
                    , 390, 400, 390, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+390
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+390
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '54', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '6517';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1818', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '55.00', '54', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20115;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('430','01808', '18498', '1', '1808', '1', '440', '440', '0', '', '2', '2024-10-22 21:21:44', '1808', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','20115-1,');
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
                where sellbilldetailid = 54516;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1808, '2024-10-22', 440, 430, 430
                    , 430, 430, 430, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 440, 430, 430
                    , 430, 430, 430, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+440, sellCostBuyPrice =sellCostBuyPrice+430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+430
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+430
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '17', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '6521';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1808', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18.00', '17', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 17151;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('255','01459', '18498', '1', '1459', '1', '360', '360', '0', '', '2', '2024-10-22 21:21:44', '1459', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','17151-1,');
UPDATE sellbilldetail SET  lastbuyprice = 255.00 , meanbuyprice = 302.50, lastbuyprice_withDiscount = 255.00, meanbuyprice_withDiscount = 302.50
                where sellbilldetailid = 54517;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1459, '2024-10-22', 360, 350, 255
                    , 302.5, 255, 302.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+255, sellCostMeanBuyPrice = sellCostMeanBuyPrice+302.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+255, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+302.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 360, 350, 255
                    , 302.5, 255, 302.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+255, sellCostMeanBuyPrice = sellCostMeanBuyPrice+302.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+255, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+302.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '3', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '5418';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1459', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4.00', '3', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 16503;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('300','01492', '18498', '1', '1492', '1', '340', '340', '0', '', '2', '2024-10-22 21:21:44', '1492', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','16503-1,');
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
                where sellbilldetailid = 54518;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1492, '2024-10-22', 340, 300, 300
                    , 300, 300, 300, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 340, 300, 300
                    , 300, 300, 300, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+340, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '5', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '5489';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1492', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6.00', '5', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 16719;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('350','01495', '18498', '1', '1495', '1', '390', '390', '0', '', '2', '2024-10-22 21:21:44', '1495', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','16719-1,');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
                where sellbilldetailid = 54519;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1495, '2024-10-22', 390, 350, 350
                    , 350, 350, 350, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 390, 350, 350
                    , 350, 350, 350, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+390, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '0', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '5488';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1495', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '1.00', '0', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 18325;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('350','01722', '18498', '1', '1722', '1', '360', '360', '0', '', '2', '2024-10-22 21:21:44', '1722', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','18325-1,');
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
                where sellbilldetailid = 54520;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1722, '2024-10-22', 360, 350, 350
                    , 350, 350, 350, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 360, 350, 350
                    , 350, 350, 350, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '6', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '6233';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1722', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7.00', '6', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20247;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('440','01833', '18498', '1', '1833', '1', '480', '480', '0', '', '2', '2024-10-22 21:21:44', '1833', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','20247-1,');
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
                where sellbilldetailid = 54521;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1833, '2024-10-22', 480, 440, 440
                    , 440, 440, 440, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 480, 440, 440
                    , 440, 440, 440, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+480, sellCostBuyPrice =sellCostBuyPrice+440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '13', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '6575';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1833', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '14.00', '13', '3', '2024-10-22 21:21:44','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 19989;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('400','01805', '18498', '1', '1805', '1', '410', '410', '0', '', '2', '2024-10-22 21:21:44', '1805', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','19989-1,');
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
                where sellbilldetailid = 54522;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1805, '2024-10-22', 410, 400, 400
                    , 400, 400, 400, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 410, 400, 400
                    , 400, 400, 400, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+410, sellCostBuyPrice =sellCostBuyPrice+400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '33', userid = '3', storedetaildate = '2024-10-22 21:21:44' WHERE storedetailid = '6538';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1805', '8', '1', '1', '18498', 'اضافة فاتورة مبيعات', 'sellbillController.php', '34.00', '33', '3', '2024-10-22 21:21:44','0','0');
UPDATE save SET  savecurrentvalue = '19185',  userid = '3' WHERE saveid = '8';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('14495.00','4690', '0', '8', 'اضافة فاتورة مبيعات', '18498', '19185', '2024-10-22 21:21:44', '3',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2024-10-22', 4690, 4430, 4305
                    , 4367.5, 4305, 4367.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4690, sellCostBuyPrice =sellCostBuyPrice+4430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4305, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4367.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4305, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4367.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 4690, 4430, 4305
                    , 4367.5, 4305, 4367.5, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4690, sellCostBuyPrice =sellCostBuyPrice+4430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4305, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4367.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4305, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4367.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 4690, 4430, 4305
                    , 4367.5, 4305, 4367.5, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4690, netSellCostBuyPrice = netSellCostBuyPrice+4430
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4305
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4367.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4305
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4367.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06717e9bbd0f31 and sellbillId = 18498 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:51:44";
UPDATE user SET loginip = "197.32.128.87", lastactivetime = "2024-10-22 21:21:44", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 21:21:44', '3', 'addsellBill', '197.32.128.87', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:56:24";
UPDATE user SET loginip = "197.32.128.87", lastactivetime = "2024-10-22 21:26:24", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 21:26:24', '3', 'addAndRetuen', '197.32.128.87', '', 'DESKTOP');

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06717ed392487a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate) VALUES ('2024-10-22 21:21:45', '06717ed392487a', '1', '0.00', '0', '0', '1', '1705', '1705', '1705', '0', '8', '2024-10-22 21:26:24', '', '3', '0', 'نقدي', '8', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','1705','0','','0','0','1705','0','0','0','0','0','0','0','0','');
UPDATE client SET  clientdebt = '0', userid = '3' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor ) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','18499', '0', '2024-10-22 21:26:24', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1705', '0', null, '0', null, null,'', '0','1','1','0','1');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 17997;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('200','01686', '18499', '1', '1686', '1', '210', '210', '0', '', '2', '2024-10-22 21:26:24', '1686', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','17997-1,');
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
                where sellbilldetailid = 54523;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1686, '2024-10-22', 210, 200, 200
                    , 200, 200, 200, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 210, 200, 200
                    , 200, 200, 200, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+210, sellCostBuyPrice =sellCostBuyPrice+200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '7', userid = '3', storedetaildate = '2024-10-22 21:26:24' WHERE storedetailid = '6125';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1686', '8', '1', '1', '18499', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8.00', '7', '3', '2024-10-22 21:26:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 19993;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('150','00167', '18499', '1', '167', '1', '165', '165', '0', '', '2', '2024-10-22 21:26:24', '167', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','19993-1,');
UPDATE sellbilldetail SET  lastbuyprice = 150.00 , meanbuyprice = 150.00, lastbuyprice_withDiscount = 150.00, meanbuyprice_withDiscount = 150.00
                where sellbilldetailid = 54524;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (167, '2024-10-22', 165, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 165, 150, 150
                    , 150, 150, 150, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+165, sellCostBuyPrice =sellCostBuyPrice+150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '5', userid = '3', storedetaildate = '2024-10-22 21:26:24' WHERE storedetailid = '6540';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('167', '8', '1', '1', '18499', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6.00', '5', '3', '2024-10-22 21:26:24','0','0');
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('330','01810', '18499', '1', '1810', '1', '370', '370', '0', '', '2', '2024-10-22 21:26:24', '1810', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','');
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
                where sellbilldetailid = 54525;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1810, '2024-10-22', 370, 330, 330
                    , 330, 330, 330, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 370, 330, 330
                    , 330, 330, 330, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+370, sellCostBuyPrice =sellCostBuyPrice+330
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+330, sellCostMeanBuyPrice = sellCostMeanBuyPrice+330
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+330, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+330
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '7', userid = '3', storedetaildate = '2024-10-22 21:26:24' WHERE storedetailid = '6493';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1810', '8', '1', '1', '18499', 'اضافة فاتورة مبيعات', 'sellbillController.php', '8.00', '7', '3', '2024-10-22 21:26:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 17067;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('410','01582', '18499', '1', '1582', '1', '420', '420', '0', '', '2', '2024-10-22 21:26:24', '1582', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','17067-1,');
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
                where sellbilldetailid = 54526;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1582, '2024-10-22', 420, 410, 410
                    , 410, 410, 410, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 420, 410, 410
                    , 410, 410, 410, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+420, sellCostBuyPrice =sellCostBuyPrice+410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+410, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+410
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '21', userid = '3', storedetaildate = '2024-10-22 21:26:24' WHERE storedetailid = '5770';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1582', '8', '1', '1', '18499', 'اضافة فاتورة مبيعات', 'sellbillController.php', '22.00', '21', '3', '2024-10-22 21:26:24','0','0');
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 20249;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity) VALUES ('500','01834', '18499', '1', '1834', '1', '540', '540', '0', '', '2', '2024-10-22 21:26:24', '1834', '0.00', '0', '8','0','','','0','0','0','0','0','0','2','0','','20249-1,');
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 500.00, meanbuyprice_withDiscount = 500.00
                where sellbilldetailid = 54527;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet)
                    VALUES (1834, '2024-10-22', 540, 500, 500
                    , 500, 500, 500, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice)
                    VALUES (8, '2024-10-22', 540, 500, 500
                    , 500, 500, 500, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
UPDATE storedetail SET  productquantity = '11', userid = '3', storedetaildate = '2024-10-22 21:26:24' WHERE storedetailid = '6576';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1834', '8', '1', '1', '18499', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12.00', '11', '3', '2024-10-22 21:26:24','0','0');
UPDATE save SET  savecurrentvalue = '20890',  userid = '3' WHERE saveid = '8';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('19185.00','1705', '0', '8', 'اضافة فاتورة مبيعات', '18499', '20890', '2024-10-22 21:26:24', '3',  'sellbillController.php','1','');
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES ('2024-10-22', 1705, 1590, 1590
                    , 1590, 1590, 1590, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1705, sellCostBuyPrice =sellCostBuyPrice+1590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1590, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1590
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice)
                    VALUES (1, '2024-10-22', 1705, 1590, 1590
                    , 1590, 1590, 1590, 0
                    , 0, 0, 0, 0
                    , 0, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1705, sellCostBuyPrice =sellCostBuyPrice+1590
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1590, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1590
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1590, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1590
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                        , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice)
                    VALUES (1, 1705, 1590, 1590
                    , 1590, 1590, 1590, 0)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1705, netSellCostBuyPrice = netSellCostBuyPrice+1590
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1590
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1590
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1590
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1590
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+0;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06717ed392487a and sellbillId = 18499 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:56:25";
UPDATE user SET loginip = "197.32.128.87", lastactivetime = "2024-10-22 21:26:25", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 21:26:25', '3', 'addsellBill', '197.32.128.87', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 17:56:27";
UPDATE user SET loginip = "197.32.128.87", lastactivetime = "2024-10-22 21:26:27", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2024-10-22 21:26:27', '3', '', '197.32.128.87', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:01:54";
UPDATE user SET loginip = "197.32.139.64", lastactivetime = "2024-10-22 21:31:54", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 21:31:54', '3', 'addsellBill', '197.32.139.64', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:01:57";
UPDATE user SET loginip = "197.32.139.64", lastactivetime = "2024-10-22 21:31:57", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2024-10-22 21:31:57', '3', '', '197.32.139.64', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE userid = 1;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:13:13";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 21:43:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2024-10-22 21:43:14', '1', '', '156.210.76.86', '', '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 < "2024-10-22 18:13:14";
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 < "2024-10-22 18:13:42";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 21:43:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 21:43:42', '1', 'addsellBill', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:13:43";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 21:43:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 21:43:43', '1', 'addsellBill', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:25:55";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 21:55:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 21:55:56', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:26:18";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 21:56:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 21:56:18', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:26:39";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 21:56:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 21:56:39', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '907الوليد', productDescription = '', productCatId = '1', productBuyPrice = '320', productSellAllPrice = '280.00', productSellUnitPrice = '340.00', productSellHalfPrice = '300.00', productDate = '2022-11-09', conditions = '0', userId = '1', limitamount = '0', parcode = '01172',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '295',meanbuyprice_withDiscount = '295' , productbuypricereal = '280.00' , buypricereal_precentage = '3.70' , buytotal_precentage = '3.70' , buyhalf_precentage = '11.11' , buypart_precentage = '25.93',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1172';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1172, 1,'2024-10-22 21:57:15',1)
                ON DUPLICATE KEY UPDATE productid = 1172, edited = 1, sysdate = '2024-10-22 21:57:15', userid = 1;
UPDATE product SET productName = '907الوليد', productDescription = '', productCatId = '1', productBuyPrice = '320.00', productSellAllPrice = '320', productSellUnitPrice = '320', productSellHalfPrice = '320', productDate = '2022-11-09', conditions = '0', userId = '1', limitamount = '0', parcode = '01172',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '295.00',meanbuyprice_withDiscount = '295' , productbuypricereal = '280.00' , buypricereal_precentage = '3.70' , buytotal_precentage = '3.70' , buyhalf_precentage = '11.11' , buypart_precentage = '25.93',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1172';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1172, 1,'2024-10-22 21:57:18',1)
                ON DUPLICATE KEY UPDATE productid = 1172, edited = 1, sysdate = '2024-10-22 21:57:18', userid = 1;
UPDATE product SET productName = '907الوليد', productDescription = '', productCatId = '1', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '330', productDate = '2022-11-09', conditions = '0', userId = '1', limitamount = '0', parcode = '01172',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '295.00',meanbuyprice_withDiscount = '295' , productbuypricereal = '280.00' , buypricereal_precentage = '3.70' , buytotal_precentage = '3.70' , buyhalf_precentage = '11.11' , buypart_precentage = '25.93',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1172';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1172, 1,'2024-10-22 21:57:22',1)
                ON DUPLICATE KEY UPDATE productid = 1172, edited = 1, sysdate = '2024-10-22 21:57:22', userid = 1;
UPDATE product SET productName = '907الوليد', productDescription = '', productCatId = '1', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '410', productSellHalfPrice = '330.00', productDate = '2022-11-09', conditions = '0', userId = '1', limitamount = '0', parcode = '01172',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '295.00',meanbuyprice_withDiscount = '295' , productbuypricereal = '280.00' , buypricereal_precentage = '3.70' , buytotal_precentage = '3.70' , buyhalf_precentage = '11.11' , buypart_precentage = '25.93',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1172';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1172, 1,'2024-10-22 21:57:34',1)
                ON DUPLICATE KEY UPDATE productid = 1172, edited = 1, sysdate = '2024-10-22 21:57:34', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:28:25";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 21:58:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 21:58:25', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '5024 ', productDescription = '', productCatId = '1', productBuyPrice = '260.00', productSellAllPrice = '260.00', productSellUnitPrice = '300.00', productSellHalfPrice = '280.00', productDate = '2022-08-18', conditions = '0', userId = '1', limitamount = '0', parcode = '01126',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '210.00',lastbuyprice_withDiscount = '210',meanbuyprice = '355.03',meanbuyprice_withDiscount = '355.03' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.69' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1126';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1126, 1,'2024-10-22 21:58:35',1)
                ON DUPLICATE KEY UPDATE productid = 1126, edited = 1, sysdate = '2024-10-22 21:58:35', userid = 1;
UPDATE product SET productName = '5024 ', productDescription = '', productCatId = '1', productBuyPrice = '330', productSellAllPrice = '260.00', productSellUnitPrice = '300.00', productSellHalfPrice = '280.00', productDate = '2022-08-18', conditions = '0', userId = '1', limitamount = '0', parcode = '01126',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '210.00',lastbuyprice_withDiscount = '210',meanbuyprice = '342.52',meanbuyprice_withDiscount = '342.52' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.69' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1126';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1126, 1,'2024-10-22 21:58:45',1)
                ON DUPLICATE KEY UPDATE productid = 1126, edited = 1, sysdate = '2024-10-22 21:58:45', userid = 1;
UPDATE product SET productName = '5024 ', productDescription = '', productCatId = '1', productBuyPrice = '330.00', productSellAllPrice = '330', productSellUnitPrice = '330', productSellHalfPrice = '330', productDate = '2022-08-18', conditions = '0', userId = '1', limitamount = '0', parcode = '01126',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '210.00',lastbuyprice_withDiscount = '210',meanbuyprice = '342.52',meanbuyprice_withDiscount = '342.52' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.69' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1126';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1126, 1,'2024-10-22 21:58:48',1)
                ON DUPLICATE KEY UPDATE productid = 1126, edited = 1, sysdate = '2024-10-22 21:58:48', userid = 1;
UPDATE product SET productName = '5024 ', productDescription = '', productCatId = '1', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '340', productDate = '2022-08-18', conditions = '0', userId = '1', limitamount = '0', parcode = '01126',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '210.00',lastbuyprice_withDiscount = '210',meanbuyprice = '342.52',meanbuyprice_withDiscount = '342.52' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.69' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1126';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1126, 1,'2024-10-22 21:58:51',1)
                ON DUPLICATE KEY UPDATE productid = 1126, edited = 1, sysdate = '2024-10-22 21:58:51', userid = 1;
UPDATE product SET productName = '5024 ', productDescription = '', productCatId = '1', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '420', productSellHalfPrice = '340.00', productDate = '2022-08-18', conditions = '0', userId = '1', limitamount = '0', parcode = '01126',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '210.00',lastbuyprice_withDiscount = '210',meanbuyprice = '342.52',meanbuyprice_withDiscount = '342.52' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.69' , buypart_precentage = '15.38',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1126';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1126, 1,'2024-10-22 21:59:47',1)
                ON DUPLICATE KEY UPDATE productid = 1126, edited = 1, sysdate = '2024-10-22 21:59:47', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:30:09";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:00:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:00:09', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '910 الوليد', productDescription = '', productCatId = '1', productBuyPrice = '310', productSellAllPrice = '270.00', productSellUnitPrice = '350.00', productSellHalfPrice = '290.00', productDate = '2022-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01183',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '160.00',lastbuyprice_withDiscount = '160',meanbuyprice = '260',meanbuyprice_withDiscount = '260' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '11.54' , buypart_precentage = '23.08',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1183';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1183, 1,'2024-10-22 22:00:26',1)
                ON DUPLICATE KEY UPDATE productid = 1183, edited = 1, sysdate = '2024-10-22 22:00:26', userid = 1;
UPDATE product SET productName = '910 الوليد', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310', productSellUnitPrice = '310', productSellHalfPrice = '310', productDate = '2022-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01183',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '160.00',lastbuyprice_withDiscount = '160',meanbuyprice = '260.00',meanbuyprice_withDiscount = '260' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '11.54' , buypart_precentage = '23.08',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1183';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1183, 1,'2024-10-22 22:00:34',1)
                ON DUPLICATE KEY UPDATE productid = 1183, edited = 1, sysdate = '2024-10-22 22:00:34', userid = 1;
UPDATE product SET productName = '910 الوليد', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '320', productDate = '2022-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01183',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '160.00',lastbuyprice_withDiscount = '160',meanbuyprice = '260.00',meanbuyprice_withDiscount = '260' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '11.54' , buypart_precentage = '23.08',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1183';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1183, 1,'2024-10-22 22:00:37',1)
                ON DUPLICATE KEY UPDATE productid = 1183, edited = 1, sysdate = '2024-10-22 22:00:37', userid = 1;
UPDATE product SET productName = '910 الوليد', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310.00', productSellUnitPrice = '400', productSellHalfPrice = '320.00', productDate = '2022-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01183',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '160.00',lastbuyprice_withDiscount = '160',meanbuyprice = '260.00',meanbuyprice_withDiscount = '260' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '11.54' , buypart_precentage = '23.08',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1183';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1183, 1,'2024-10-22 22:00:43',1)
                ON DUPLICATE KEY UPDATE productid = 1183, edited = 1, sysdate = '2024-10-22 22:00:43', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:31:19";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:01:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:01:19', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '909الوليد', productDescription = '', productCatId = '1', productBuyPrice = '300', productSellAllPrice = '270.00', productSellUnitPrice = '350.00', productSellHalfPrice = '290.00', productDate = '2022-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01182',type ='0', expireDate = '0' , dailyentryId = '5384',isService = '0',isOptic = '0',lastbuyprice = '260.00',lastbuyprice_withDiscount = '260',meanbuyprice = '280',meanbuyprice_withDiscount = '280' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '11.54' , buypart_precentage = '23.08',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1182';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1182, 1,'2024-10-22 22:01:41',1)
                ON DUPLICATE KEY UPDATE productid = 1182, edited = 1, sysdate = '2024-10-22 22:01:41', userid = 1;
UPDATE product SET productName = '909الوليد', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '300', productSellUnitPrice = '300', productSellHalfPrice = '300', productDate = '2022-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01182',type ='0', expireDate = '0' , dailyentryId = '5384',isService = '0',isOptic = '0',lastbuyprice = '260.00',lastbuyprice_withDiscount = '260',meanbuyprice = '280.00',meanbuyprice_withDiscount = '280' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '11.54' , buypart_precentage = '23.08',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1182';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1182, 1,'2024-10-22 22:01:45',1)
                ON DUPLICATE KEY UPDATE productid = 1182, edited = 1, sysdate = '2024-10-22 22:01:45', userid = 1;
UPDATE product SET productName = '909الوليد', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '320', productDate = '2022-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01182',type ='0', expireDate = '0' , dailyentryId = '5384',isService = '0',isOptic = '0',lastbuyprice = '260.00',lastbuyprice_withDiscount = '260',meanbuyprice = '280.00',meanbuyprice_withDiscount = '280' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '11.54' , buypart_precentage = '23.08',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1182';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1182, 1,'2024-10-22 22:01:55',1)
                ON DUPLICATE KEY UPDATE productid = 1182, edited = 1, sysdate = '2024-10-22 22:01:55', userid = 1;
UPDATE product SET productName = '909الوليد', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '300.00', productSellUnitPrice = '380', productSellHalfPrice = '320.00', productDate = '2022-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01182',type ='0', expireDate = '0' , dailyentryId = '5384',isService = '0',isOptic = '0',lastbuyprice = '260.00',lastbuyprice_withDiscount = '260',meanbuyprice = '280.00',meanbuyprice_withDiscount = '280' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.85' , buyhalf_precentage = '11.54' , buypart_precentage = '23.08',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1182';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1182, 1,'2024-10-22 22:02:03',1)
                ON DUPLICATE KEY UPDATE productid = 1182, edited = 1, sysdate = '2024-10-22 22:02:03', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:32:42";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:02:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:02:42', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '902الوليد', productDescription = '', productCatId = '1', productBuyPrice = '310', productSellAllPrice = '270.00', productSellUnitPrice = '350.00', productSellHalfPrice = '290.00', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01162',type ='0', expireDate = '0' , dailyentryId = '5083',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.41' , buypart_precentage = '18.52',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1162';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1162, 1,'2024-10-22 22:02:51',1)
                ON DUPLICATE KEY UPDATE productid = 1162, edited = 1, sysdate = '2024-10-22 22:02:51', userid = 1;
UPDATE product SET productName = '902الوليد', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310', productSellUnitPrice = '310', productSellHalfPrice = '310', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01162',type ='0', expireDate = '0' , dailyentryId = '5083',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '290.00',meanbuyprice_withDiscount = '290' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.41' , buypart_precentage = '18.52',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1162';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1162, 1,'2024-10-22 22:02:55',1)
                ON DUPLICATE KEY UPDATE productid = 1162, edited = 1, sysdate = '2024-10-22 22:02:55', userid = 1;
UPDATE product SET productName = '902الوليد', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '320', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01162',type ='0', expireDate = '0' , dailyentryId = '5083',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '290.00',meanbuyprice_withDiscount = '290' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.41' , buypart_precentage = '18.52',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1162';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1162, 1,'2024-10-22 22:02:59',1)
                ON DUPLICATE KEY UPDATE productid = 1162, edited = 1, sysdate = '2024-10-22 22:02:59', userid = 1;
UPDATE product SET productName = '902الوليد', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310.00', productSellUnitPrice = '390', productSellHalfPrice = '320.00', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01162',type ='0', expireDate = '0' , dailyentryId = '5083',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '290.00',meanbuyprice_withDiscount = '290' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.41' , buypart_precentage = '18.52',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1162';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1162, 1,'2024-10-22 22:03:19',1)
                ON DUPLICATE KEY UPDATE productid = 1162, edited = 1, sysdate = '2024-10-22 22:03:19', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:33:34";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:03:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:03:34', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '903الوليد', productDescription = '', productCatId = '1', productBuyPrice = '300', productSellAllPrice = '270.00', productSellUnitPrice = '320.00', productSellHalfPrice = '290.00', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01163',type ='0', expireDate = '0' , dailyentryId = '5084',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '285',meanbuyprice_withDiscount = '285' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.41' , buypart_precentage = '18.52',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1163';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1163, 1,'2024-10-22 22:03:42',1)
                ON DUPLICATE KEY UPDATE productid = 1163, edited = 1, sysdate = '2024-10-22 22:03:42', userid = 1;
UPDATE product SET productName = '903الوليد', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '310', productSellUnitPrice = '310', productSellHalfPrice = '310', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01163',type ='0', expireDate = '0' , dailyentryId = '5084',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '285.00',meanbuyprice_withDiscount = '285' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.41' , buypart_precentage = '18.52',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1163';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1163, 1,'2024-10-22 22:03:45',1)
                ON DUPLICATE KEY UPDATE productid = 1163, edited = 1, sysdate = '2024-10-22 22:03:45', userid = 1;
UPDATE product SET productName = '903الوليد', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '320', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01163',type ='0', expireDate = '0' , dailyentryId = '5084',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '285.00',meanbuyprice_withDiscount = '285' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.41' , buypart_precentage = '18.52',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1163';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1163, 1,'2024-10-22 22:03:48',1)
                ON DUPLICATE KEY UPDATE productid = 1163, edited = 1, sysdate = '2024-10-22 22:03:48', userid = 1;
UPDATE product SET productName = '903الوليد', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '310.00', productSellUnitPrice = '390', productSellHalfPrice = '320.00', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01163',type ='0', expireDate = '0' , dailyentryId = '5084',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '285.00',meanbuyprice_withDiscount = '285' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '7.41' , buypart_precentage = '18.52',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1163';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1163, 1,'2024-10-22 22:04:05',1)
                ON DUPLICATE KEY UPDATE productid = 1163, edited = 1, sysdate = '2024-10-22 22:04:05', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:35:02";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:05:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:05:02', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:36:26";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:06:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:06:26', '1', 'add', '156.210.76.86', '', '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 ('2042 شتوي الحوت','','1','310','320', '400','330', '2024-10-22', '0', '1', '0', '', '0', '0', '0', '0', '0', '310','310','310','310','310','0','3.23','6.45','29.03','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '2042 شتوي الحوت', productDescription = '', productCatId = '1', productBuyPrice = '310', productSellAllPrice = '320', productSellUnitPrice = '400', productSellHalfPrice = '330', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01844',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '310',lastbuyprice_withDiscount = '310',meanbuyprice = '310',meanbuyprice_withDiscount = '310' , productbuypricereal = '310' , buypricereal_precentage = '0' , buytotal_precentage = '3.23' , buyhalf_precentage = '6.45' , buypart_precentage = '29.03',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1844';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1844', '1', '2024-10-22', '1', '0','0184401','320','330','400','310');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1844', '1', '1', '1', '2024-10-22');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1844', '1', '1', '0', '1844', 'إضافة منتج', 'productController.php', '0', '1', '1', '2024-10-22','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1844, 1,'2024-10-22 22:06:26',1)
                ON DUPLICATE KEY UPDATE productid = 1844, edited = 1, sysdate = '2024-10-22 22:06:26', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '310', '310', '2024-10-22', '1', '0', '0', '2024-10-22 22:06:26','إضافة منتج 2042 شتوي الحوت الكمية 1','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11176', '19', '310', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '21411440.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11176', '7', '310', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '22169791.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '2042 شتوي الحوت', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '320.00', productSellUnitPrice = '400.00', productSellHalfPrice = '330.00', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01844',type ='0', expireDate = '0' , dailyentryId = '11176',isService = '0',isOptic = '0',lastbuyprice = '310',lastbuyprice_withDiscount = '310',meanbuyprice = '310',meanbuyprice_withDiscount = '310' , productbuypricereal = '310' , buypricereal_precentage = '0' , buytotal_precentage = '3.23' , buyhalf_precentage = '6.45' , buypart_precentage = '29.03',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1844';
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 ('2041 شتوي الحوت','','1','320','320', '410','330', '2024-10-22', '0', '1', '0', '', '0', '0', '0', '0', '0', '320','320','320','320','320','0','0','3.13','28.13','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '2041 شتوي الحوت', productDescription = '', productCatId = '1', productBuyPrice = '320', productSellAllPrice = '320', productSellUnitPrice = '410', productSellHalfPrice = '330', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01845',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320',meanbuyprice_withDiscount = '320' , productbuypricereal = '320' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '3.13' , buypart_precentage = '28.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1845';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1845', '1', '2024-10-22', '1', '0','0184501','320','330','410','320');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1845', '1', '5', '1', '2024-10-22');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1845', '1', '5', '0', '1845', 'إضافة منتج', 'productController.php', '0', '5', '1', '2024-10-22','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1845, 1,'2024-10-22 22:06:26',1)
                ON DUPLICATE KEY UPDATE productid = 1845, edited = 1, sysdate = '2024-10-22 22:06:26', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '1600', '1600', '2024-10-22', '1', '0', '0', '2024-10-22 22:06:26','إضافة منتج 2041 شتوي الحوت الكمية 5','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11177', '19', '1600', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '21413040.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11177', '7', '1600', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '22171391.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '2041 شتوي الحوت', productDescription = '', productCatId = '1', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '410.00', productSellHalfPrice = '330.00', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01845',type ='0', expireDate = '0' , dailyentryId = '11177',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320',meanbuyprice_withDiscount = '320' , productbuypricereal = '320' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '3.13' , buypart_precentage = '28.13',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1845';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:36:28";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:06:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:06:29', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:36:35";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:06:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:06:35', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:36:35";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:06:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:06:35', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:37:09";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:07:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:07:09', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:37:32";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:07:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:07:32', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:38:06";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:08:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:08:06', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:38:07";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:08:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:08:07', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:38:59";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:09:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:09:00', '1', 'add', '156.210.76.86', '', '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 ('11 شتوي الحوت','','1','330','330', '420','340', '2024-10-22', '0', '1', '0', '', '0', '0', '0', '0', '0', '330','330','330','330','330','0','0','3.03','27.27','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '11 شتوي الحوت', productDescription = '', productCatId = '1', productBuyPrice = '330', productSellAllPrice = '330', productSellUnitPrice = '420', productSellHalfPrice = '340', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01846',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '330',meanbuyprice_withDiscount = '330' , productbuypricereal = '330' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '3.03' , buypart_precentage = '27.27',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1846';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1846', '1', '2024-10-22', '1', '0','0184601','330','340','420','330');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1846', '1', '8', '1', '2024-10-22');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1846', '1', '8', '0', '1846', 'إضافة منتج', 'productController.php', '0', '8', '1', '2024-10-22','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1846, 1,'2024-10-22 22:09:00',1)
                ON DUPLICATE KEY UPDATE productid = 1846, edited = 1, sysdate = '2024-10-22 22:09:00', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '2640', '2640', '2024-10-22', '1', '0', '0', '2024-10-22 22:09:00','إضافة منتج 11 شتوي الحوت الكمية 8','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11178', '19', '2640', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '21415680.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11178', '7', '2640', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '22174031.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '11 شتوي الحوت', productDescription = '', productCatId = '1', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '420.00', productSellHalfPrice = '340.00', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01846',type ='0', expireDate = '0' , dailyentryId = '11178',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '330',meanbuyprice_withDiscount = '330' , productbuypricereal = '330' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '3.03' , buypart_precentage = '27.27',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1846';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:39:02";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:09:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:09:02', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:39:07";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:09:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:09:08', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:39:08";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:09:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:09:08', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:39:21";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:09:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:09:21', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:39:57";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:09:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:09:57', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = 'سامر شتوي', productDescription = '', productCatId = '1', productBuyPrice = '280', productSellAllPrice = '210.00', productSellUnitPrice = '250.00', productSellHalfPrice = '230.00', productDate = '2022-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01137',type ='0', expireDate = '0' , dailyentryId = '4922',isService = '0',isOptic = '0',lastbuyprice = '190.00',lastbuyprice_withDiscount = '190',meanbuyprice = '235',meanbuyprice_withDiscount = '235' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.53' , buyhalf_precentage = '21.05' , buypart_precentage = '31.58',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1137';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1137, 1,'2024-10-22 22:10:13',1)
                ON DUPLICATE KEY UPDATE productid = 1137, edited = 1, sysdate = '2024-10-22 22:10:13', userid = 1;
UPDATE product SET productName = 'سامر شتوي', productDescription = '', productCatId = '1', productBuyPrice = '280.00', productSellAllPrice = '280', productSellUnitPrice = '280', productSellHalfPrice = '280', productDate = '2022-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01137',type ='0', expireDate = '0' , dailyentryId = '4922',isService = '0',isOptic = '0',lastbuyprice = '190.00',lastbuyprice_withDiscount = '190',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.53' , buyhalf_precentage = '21.05' , buypart_precentage = '31.58',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1137';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1137, 1,'2024-10-22 22:10:20',1)
                ON DUPLICATE KEY UPDATE productid = 1137, edited = 1, sysdate = '2024-10-22 22:10:20', userid = 1;
UPDATE product SET productName = 'سامر شتوي', productDescription = '', productCatId = '1', productBuyPrice = '280.00', productSellAllPrice = '280.00', productSellUnitPrice = '280.00', productSellHalfPrice = '290', productDate = '2022-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01137',type ='0', expireDate = '0' , dailyentryId = '4922',isService = '0',isOptic = '0',lastbuyprice = '190.00',lastbuyprice_withDiscount = '190',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.53' , buyhalf_precentage = '21.05' , buypart_precentage = '31.58',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1137';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1137, 1,'2024-10-22 22:10:23',1)
                ON DUPLICATE KEY UPDATE productid = 1137, edited = 1, sysdate = '2024-10-22 22:10:23', userid = 1;
UPDATE product SET productName = 'سامر شتوي', productDescription = '', productCatId = '1', productBuyPrice = '280.00', productSellAllPrice = '280.00', productSellUnitPrice = '350', productSellHalfPrice = '290.00', productDate = '2022-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01137',type ='0', expireDate = '0' , dailyentryId = '4922',isService = '0',isOptic = '0',lastbuyprice = '190.00',lastbuyprice_withDiscount = '190',meanbuyprice = '235.00',meanbuyprice_withDiscount = '235' , productbuypricereal = '190.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.53' , buyhalf_precentage = '21.05' , buypart_precentage = '31.58',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1137';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1137, 1,'2024-10-22 22:10:48',1)
                ON DUPLICATE KEY UPDATE productid = 1137, edited = 1, sysdate = '2024-10-22 22:10:48', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:41:09";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:11:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:11:09', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '903 ابونور', productDescription = '', productCatId = '1', productBuyPrice = '300', productSellAllPrice = '225.00', productSellUnitPrice = '265.00', productSellHalfPrice = '245.00', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01158',type ='0', expireDate = '0' , dailyentryId = '5066',isService = '0',isOptic = '0',lastbuyprice = '215.00',lastbuyprice_withDiscount = '215',meanbuyprice = '257.5',meanbuyprice_withDiscount = '257.5' , productbuypricereal = '215.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.65' , buyhalf_precentage = '13.95' , buypart_precentage = '23.26',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1158';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1158, 1,'2024-10-22 22:11:17',1)
                ON DUPLICATE KEY UPDATE productid = 1158, edited = 1, sysdate = '2024-10-22 22:11:17', userid = 1;
UPDATE product SET productName = '903 ابونور', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '300', productSellUnitPrice = '300', productSellHalfPrice = '300', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01158',type ='0', expireDate = '0' , dailyentryId = '5066',isService = '0',isOptic = '0',lastbuyprice = '215.00',lastbuyprice_withDiscount = '215',meanbuyprice = '257.50',meanbuyprice_withDiscount = '257.5' , productbuypricereal = '215.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.65' , buyhalf_precentage = '13.95' , buypart_precentage = '23.26',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1158';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1158, 1,'2024-10-22 22:11:20',1)
                ON DUPLICATE KEY UPDATE productid = 1158, edited = 1, sysdate = '2024-10-22 22:11:20', userid = 1;
UPDATE product SET productName = '903 ابونور', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '300.00', productSellUnitPrice = '300.00', productSellHalfPrice = '310', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01158',type ='0', expireDate = '0' , dailyentryId = '5066',isService = '0',isOptic = '0',lastbuyprice = '215.00',lastbuyprice_withDiscount = '215',meanbuyprice = '257.50',meanbuyprice_withDiscount = '257.5' , productbuypricereal = '215.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.65' , buyhalf_precentage = '13.95' , buypart_precentage = '23.26',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1158';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1158, 1,'2024-10-22 22:11:23',1)
                ON DUPLICATE KEY UPDATE productid = 1158, edited = 1, sysdate = '2024-10-22 22:11:23', userid = 1;
UPDATE product SET productName = '903 ابونور', productDescription = '', productCatId = '1', productBuyPrice = '300.00', productSellAllPrice = '300.00', productSellUnitPrice = '380', productSellHalfPrice = '310.00', productDate = '2022-10-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01158',type ='0', expireDate = '0' , dailyentryId = '5066',isService = '0',isOptic = '0',lastbuyprice = '215.00',lastbuyprice_withDiscount = '215',meanbuyprice = '257.50',meanbuyprice_withDiscount = '257.5' , productbuypricereal = '215.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.65' , buyhalf_precentage = '13.95' , buypart_precentage = '23.26',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1158';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1158, 1,'2024-10-22 22:11:38',1)
                ON DUPLICATE KEY UPDATE productid = 1158, edited = 1, sysdate = '2024-10-22 22:11:38', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:42:00";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:12:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:12:00', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '814 قطيفة شتوي', productDescription = '', productCatId = '1', productBuyPrice = '310', productSellAllPrice = '350.00', productSellUnitPrice = '430.00', productSellHalfPrice = '360.00', productDate = '2021-11-07', conditions = '0', userId = '1', limitamount = '0', parcode = '00129',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '293.75',meanbuyprice_withDiscount = '293.75' , productbuypricereal = '215.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.33' , buyhalf_precentage = '6.98' , buypart_precentage = '16.28',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '129';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (129, 1,'2024-10-22 22:12:30',1)
                ON DUPLICATE KEY UPDATE productid = 129, edited = 1, sysdate = '2024-10-22 22:12:30', userid = 1;
UPDATE product SET productName = '814 قطيفة شتوي', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '320', productSellUnitPrice = '320', productSellHalfPrice = '320', productDate = '2021-11-07', conditions = '0', userId = '1', limitamount = '0', parcode = '00129',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '293.75',meanbuyprice_withDiscount = '293.75' , productbuypricereal = '215.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.33' , buyhalf_precentage = '6.98' , buypart_precentage = '16.28',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '129';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (129, 1,'2024-10-22 22:12:33',1)
                ON DUPLICATE KEY UPDATE productid = 129, edited = 1, sysdate = '2024-10-22 22:12:33', userid = 1;
UPDATE product SET productName = '814 قطيفة شتوي', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '330', productDate = '2021-11-07', conditions = '0', userId = '1', limitamount = '0', parcode = '00129',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '293.75',meanbuyprice_withDiscount = '293.75' , productbuypricereal = '215.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.33' , buyhalf_precentage = '6.98' , buypart_precentage = '16.28',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '129';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (129, 1,'2024-10-22 22:12:37',1)
                ON DUPLICATE KEY UPDATE productid = 129, edited = 1, sysdate = '2024-10-22 22:12:37', userid = 1;
UPDATE product SET productName = '814 قطيفة شتوي', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '320.00', productSellUnitPrice = '390', productSellHalfPrice = '330.00', productDate = '2021-11-07', conditions = '0', userId = '1', limitamount = '0', parcode = '00129',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '235.00',lastbuyprice_withDiscount = '235',meanbuyprice = '293.75',meanbuyprice_withDiscount = '293.75' , productbuypricereal = '215.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.33' , buyhalf_precentage = '6.98' , buypart_precentage = '16.28',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '129';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (129, 1,'2024-10-22 22:13:04',1)
                ON DUPLICATE KEY UPDATE productid = 129, edited = 1, sysdate = '2024-10-22 22:13:04', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:44:25";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:14:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:14:25', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:44:25";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:14:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:14:26', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:45:20";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:15:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:15:20', '1', 'add', '156.210.76.86', '', '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 ('466 ست الحبايب شتوي','','1','330','330', '410','340', '2024-10-22', '0', '1', '0', '', '0', '0', '0', '0', '0', '330','330','330','330','330','0','0','3.03','24.24','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '466 ست الحبايب شتوي', productDescription = '', productCatId = '1', productBuyPrice = '330', productSellAllPrice = '330', productSellUnitPrice = '410', productSellHalfPrice = '340', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01847',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '330',meanbuyprice_withDiscount = '330' , productbuypricereal = '330' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '3.03' , buypart_precentage = '24.24',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1847';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1847', '1', '2024-10-22', '1', '0','0184701','330','340','410','330');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1847', '1', '9', '1', '2024-10-22');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1847', '1', '9', '0', '1847', 'إضافة منتج', 'productController.php', '0', '9', '1', '2024-10-22','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1847, 1,'2024-10-22 22:15:20',1)
                ON DUPLICATE KEY UPDATE productid = 1847, edited = 1, sysdate = '2024-10-22 22:15:20', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '2970', '2970', '2024-10-22', '1', '0', '0', '2024-10-22 22:15:20','إضافة منتج 466 ست الحبايب شتوي الكمية 9','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11179', '19', '2970', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '21418650.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11179', '7', '2970', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '22177001.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '466 ست الحبايب شتوي', productDescription = '', productCatId = '1', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '410.00', productSellHalfPrice = '340.00', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01847',type ='0', expireDate = '0' , dailyentryId = '11179',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '330',meanbuyprice_withDiscount = '330' , productbuypricereal = '330' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '3.03' , buypart_precentage = '24.24',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1847';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:45:22";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:15:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:15:22', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:45:40";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:15:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:15:41', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:46:33";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:16:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:16:33', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '1051اسيا', productDescription = '', productCatId = '1', productBuyPrice = '340.00', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2023-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01491',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340.00',lastbuyprice_withDiscount = '340',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.82' , buyhalf_precentage = '17.65' , buypart_precentage = '23.53',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1491';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1491, 1,'2024-10-22 22:16:47',1)
                ON DUPLICATE KEY UPDATE productid = 1491, edited = 1, sysdate = '2024-10-22 22:16:47', userid = 1;
UPDATE product SET productName = '1051اسيا', productDescription = '', productCatId = '1', productBuyPrice = '340.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '360', productDate = '2023-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01491',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340.00',lastbuyprice_withDiscount = '340',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.82' , buyhalf_precentage = '17.65' , buypart_precentage = '23.53',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1491';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1491, 1,'2024-10-22 22:17:20',1)
                ON DUPLICATE KEY UPDATE productid = 1491, edited = 1, sysdate = '2024-10-22 22:17:20', userid = 1;
UPDATE product SET productName = '1051اسيا', productDescription = '', productCatId = '1', productBuyPrice = '340.00', productSellAllPrice = '350.00', productSellUnitPrice = '420', productSellHalfPrice = '360.00', productDate = '2023-11-24', conditions = '0', userId = '1', limitamount = '0', parcode = '01491',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340.00',lastbuyprice_withDiscount = '340',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.82' , buyhalf_precentage = '17.65' , buypart_precentage = '23.53',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1491';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1491, 1,'2024-10-22 22:18:03',1)
                ON DUPLICATE KEY UPDATE productid = 1491, edited = 1, sysdate = '2024-10-22 22:18:03', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:48:05";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:18:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:18:05', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:49:39";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:19:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:19:39', '1', 'add', '156.210.76.86', '', '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 ('1090شتوي اسيا اشون','','1','360','360', '430','370', '2024-10-22', '0', '1', '0', '', '0', '0', '0', '0', '0', '360','360','360','360','360','0','0','2.78','19.44','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '1090شتوي اسيا اشون', productDescription = '', productCatId = '1', productBuyPrice = '360', productSellAllPrice = '360', productSellUnitPrice = '430', productSellHalfPrice = '370', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01848',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '2.78' , buypart_precentage = '19.44',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1848';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1848', '1', '2024-10-22', '1', '0','0184801','360','370','430','360');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1848', '1', '10', '1', '2024-10-22');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1848', '1', '10', '0', '1848', 'إضافة منتج', 'productController.php', '0', '10', '1', '2024-10-22','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1848, 1,'2024-10-22 22:19:40',1)
                ON DUPLICATE KEY UPDATE productid = 1848, edited = 1, sysdate = '2024-10-22 22:19:40', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '3600', '3600', '2024-10-22', '1', '0', '0', '2024-10-22 22:19:40','إضافة منتج 1090شتوي اسيا اشون الكمية 10','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11180', '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 = '21422250.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11180', '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 = '22180601.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '1090شتوي اسيا اشون', productDescription = '', productCatId = '1', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '430.00', productSellHalfPrice = '370.00', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01848',type ='0', expireDate = '0' , dailyentryId = '11180',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '2.78' , buypart_precentage = '19.44',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1848';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:49:41";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:19:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:19:42', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:49:47";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:19:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:19:48', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:50:07";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:20:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:20:07', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = 'اسيا 1050', productDescription = '', productCatId = '1', productBuyPrice = '340.00', productSellAllPrice = '350', productSellUnitPrice = '350', productSellHalfPrice = '350', productDate = '2023-12-08', conditions = '0', userId = '1', limitamount = '0', parcode = '01503',type ='0', expireDate = '0' , dailyentryId = '8985',isService = '0',isOptic = '0',lastbuyprice = '340.00',lastbuyprice_withDiscount = '340',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.88' , buyhalf_precentage = '11.76' , buypart_precentage = '20.59',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1503';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1503, 1,'2024-10-22 22:20:24',1)
                ON DUPLICATE KEY UPDATE productid = 1503, edited = 1, sysdate = '2024-10-22 22:20:24', userid = 1;
UPDATE product SET productName = 'اسيا 1050', productDescription = '', productCatId = '1', productBuyPrice = '340.00', productSellAllPrice = '350.00', productSellUnitPrice = '350.00', productSellHalfPrice = '360', productDate = '2023-12-08', conditions = '0', userId = '1', limitamount = '0', parcode = '01503',type ='0', expireDate = '0' , dailyentryId = '8985',isService = '0',isOptic = '0',lastbuyprice = '340.00',lastbuyprice_withDiscount = '340',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.88' , buyhalf_precentage = '11.76' , buypart_precentage = '20.59',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1503';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1503, 1,'2024-10-22 22:20:27',1)
                ON DUPLICATE KEY UPDATE productid = 1503, edited = 1, sysdate = '2024-10-22 22:20:27', userid = 1;
UPDATE product SET productName = 'اسيا 1050', productDescription = '', productCatId = '1', productBuyPrice = '340.00', productSellAllPrice = '350.00', productSellUnitPrice = '430', productSellHalfPrice = '360.00', productDate = '2023-12-08', conditions = '0', userId = '1', limitamount = '0', parcode = '01503',type ='0', expireDate = '0' , dailyentryId = '8985',isService = '0',isOptic = '0',lastbuyprice = '340.00',lastbuyprice_withDiscount = '340',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.88' , buyhalf_precentage = '11.76' , buypart_precentage = '20.59',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1503';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1503, 1,'2024-10-22 22:20:55',1)
                ON DUPLICATE KEY UPDATE productid = 1503, edited = 1, sysdate = '2024-10-22 22:20:55', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:51:46";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:21:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:21:46', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '1040 اسيا', productDescription = '', productCatId = '1', productBuyPrice = '320', productSellAllPrice = '310.00', productSellUnitPrice = '370.00', productSellHalfPrice = '330.00', productDate = '2023-08-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01454',type ='0', expireDate = '0' , dailyentryId = '8198',isService = '0',isOptic = '0',lastbuyprice = '290.00',lastbuyprice_withDiscount = '290',meanbuyprice = '305',meanbuyprice_withDiscount = '305' , productbuypricereal = '290.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.45' , buyhalf_precentage = '10.34' , buypart_precentage = '24.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1454';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1454, 1,'2024-10-22 22:21:54',1)
                ON DUPLICATE KEY UPDATE productid = 1454, edited = 1, sysdate = '2024-10-22 22:21:54', userid = 1;
UPDATE product SET productName = '1040 اسيا', productDescription = '', productCatId = '1', productBuyPrice = '320.00', productSellAllPrice = '320', productSellUnitPrice = '320', productSellHalfPrice = '320', productDate = '2023-08-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01454',type ='0', expireDate = '0' , dailyentryId = '8198',isService = '0',isOptic = '0',lastbuyprice = '290.00',lastbuyprice_withDiscount = '290',meanbuyprice = '305.00',meanbuyprice_withDiscount = '305' , productbuypricereal = '290.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.45' , buyhalf_precentage = '10.34' , buypart_precentage = '24.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1454';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1454, 1,'2024-10-22 22:21:58',1)
                ON DUPLICATE KEY UPDATE productid = 1454, edited = 1, sysdate = '2024-10-22 22:21:58', userid = 1;
UPDATE product SET productName = '1040 اسيا', productDescription = '', productCatId = '1', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '410', productSellHalfPrice = '320.00', productDate = '2023-08-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01454',type ='0', expireDate = '0' , dailyentryId = '8198',isService = '0',isOptic = '0',lastbuyprice = '290.00',lastbuyprice_withDiscount = '290',meanbuyprice = '305.00',meanbuyprice_withDiscount = '305' , productbuypricereal = '290.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.45' , buyhalf_precentage = '10.34' , buypart_precentage = '24.14',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1454';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1454, 1,'2024-10-22 22:22:30',1)
                ON DUPLICATE KEY UPDATE productid = 1454, edited = 1, sysdate = '2024-10-22 22:22:30', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:53:10";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:23:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:23:10', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '55امجاد صدر شتوي', productDescription = '', productCatId = '1', productBuyPrice = '310', productSellAllPrice = '230.00', productSellUnitPrice = '280.00', productSellHalfPrice = '250.00', productDate = '2022-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01139',type ='0', expireDate = '0' , dailyentryId = '4926',isService = '0',isOptic = '0',lastbuyprice = '220.00',lastbuyprice_withDiscount = '220',meanbuyprice = '265',meanbuyprice_withDiscount = '265' , productbuypricereal = '220.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '13.64' , buypart_precentage = '27.27',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1139';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1139, 1,'2024-10-22 22:23:17',1)
                ON DUPLICATE KEY UPDATE productid = 1139, edited = 1, sysdate = '2024-10-22 22:23:17', userid = 1;
UPDATE product SET productName = '55امجاد صدر شتوي', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310', productSellUnitPrice = '310', productSellHalfPrice = '310', productDate = '2022-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01139',type ='0', expireDate = '0' , dailyentryId = '4926',isService = '0',isOptic = '0',lastbuyprice = '220.00',lastbuyprice_withDiscount = '220',meanbuyprice = '265.00',meanbuyprice_withDiscount = '265' , productbuypricereal = '220.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '13.64' , buypart_precentage = '27.27',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1139';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1139, 1,'2024-10-22 22:23:20',1)
                ON DUPLICATE KEY UPDATE productid = 1139, edited = 1, sysdate = '2024-10-22 22:23:20', userid = 1;
UPDATE product SET productName = '55امجاد صدر شتوي', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '320', productDate = '2022-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01139',type ='0', expireDate = '0' , dailyentryId = '4926',isService = '0',isOptic = '0',lastbuyprice = '220.00',lastbuyprice_withDiscount = '220',meanbuyprice = '265.00',meanbuyprice_withDiscount = '265' , productbuypricereal = '220.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '13.64' , buypart_precentage = '27.27',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1139';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1139, 1,'2024-10-22 22:23:23',1)
                ON DUPLICATE KEY UPDATE productid = 1139, edited = 1, sysdate = '2024-10-22 22:23:23', userid = 1;
UPDATE product SET productName = '55امجاد صدر شتوي', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310.00', productSellUnitPrice = '390', productSellHalfPrice = '320.00', productDate = '2022-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01139',type ='0', expireDate = '0' , dailyentryId = '4926',isService = '0',isOptic = '0',lastbuyprice = '220.00',lastbuyprice_withDiscount = '220',meanbuyprice = '265.00',meanbuyprice_withDiscount = '265' , productbuypricereal = '220.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.55' , buyhalf_precentage = '13.64' , buypart_precentage = '27.27',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1139';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1139, 1,'2024-10-22 22:23:43',1)
                ON DUPLICATE KEY UPDATE productid = 1139, edited = 1, sysdate = '2024-10-22 22:23:43', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:54:10";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:24:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:24:11', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:54:51";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:24:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:24:51', '1', 'add', '156.210.76.86', '', '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 ('2036 شتوي الحوت','','1','290','300', '390','310', '2024-10-22', '0', '1', '0', '', '0', '0', '0', '0', '0', '290','290','290','290','290','0','3.45','6.9','34.48','.','0','0','0','0','0','','','0','0','0');
UPDATE product SET productName = '2036 شتوي الحوت', productDescription = '', productCatId = '1', productBuyPrice = '290', productSellAllPrice = '300', productSellUnitPrice = '390', productSellHalfPrice = '310', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01849',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 = '3.45' , buyhalf_precentage = '6.9' , buypart_precentage = '34.48',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1849';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice) VALUES ('1', '1849', '1', '2024-10-22', '1', '0','0184901','300','310','390','290');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1849', '1', '1', '1', '2024-10-22');
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1849', '1', '1', '0', '1849', 'إضافة منتج', 'productController.php', '0', '1', '1', '2024-10-22','0','0');
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1849, 1,'2024-10-22 22:24:51',1)
                ON DUPLICATE KEY UPDATE productid = 1849, edited = 1, sysdate = '2024-10-22 22:24:51', userid = 1;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '290', '290', '2024-10-22', '1', '0', '0', '2024-10-22 22:24:51','إضافة منتج 2036 شتوي الحوت الكمية 1','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11181', '19', '290', '','0');
UPDATE accountstree SET name = 'البضاعة (بضاعة أول المدة)', customName = 'البضاعة (بضاعة أول المدة)', parent = '6', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '0', mydate = '0000-00-00', itemtype2 = '1', theValue = '21422540.95', theOrder = '0', layingOrder = '121',reportid = '0' WHERE id = '19';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11181', '7', '290', '','0');
UPDATE accountstree SET name = 'رأس المال', customName = 'رأس المال', parent = '25', itemtype = '1', itemfrom = '0', notes = '', del = '0', userid = '2', mydate = '2016-11-23', itemtype2 = '1', theValue = '22180891.75', theOrder = '0', layingOrder = '211',reportid = '0' WHERE id = '7';
UPDATE product SET productName = '2036 شتوي الحوت', productDescription = '', productCatId = '1', productBuyPrice = '290.00', productSellAllPrice = '300.00', productSellUnitPrice = '390.00', productSellHalfPrice = '310.00', productDate = '2024-10-22', conditions = '0', userId = '1', limitamount = '0', parcode = '01849',type ='0', expireDate = '0' , dailyentryId = '11181',isService = '0',isOptic = '0',lastbuyprice = '290',lastbuyprice_withDiscount = '290',meanbuyprice = '290',meanbuyprice_withDiscount = '290' , productbuypricereal = '290' , buypricereal_precentage = '0' , buytotal_precentage = '3.45' , buyhalf_precentage = '6.9' , buypart_precentage = '34.48',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType =null , online = '' , updatebyuser = ''  WHERE productId = '1849';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:54:53";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:24:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:24:53', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:54:58";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:24:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:24:58', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:55:10";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:25:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:25:11', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:55:41";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:25:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:25:41', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = 'مستر مروان 910', productDescription = '', productCatId = '1', productBuyPrice = '370.00', productSellAllPrice = '380', productSellUnitPrice = '380', productSellHalfPrice = '380', productDate = '2024-02-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '9553',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '370',meanbuyprice = '370.00',meanbuyprice_withDiscount = '370' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.11' , buyhalf_precentage = '10.81' , buypart_precentage = '21.62',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2024-10-22 22:25:49',1)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2024-10-22 22:25:49', userid = 1;
UPDATE product SET productName = 'مستر مروان 910', productDescription = '', productCatId = '1', productBuyPrice = '370.00', productSellAllPrice = '380.00', productSellUnitPrice = '380.00', productSellHalfPrice = '390', productDate = '2024-02-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '9553',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '370',meanbuyprice = '370.00',meanbuyprice_withDiscount = '370' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.11' , buyhalf_precentage = '10.81' , buypart_precentage = '21.62',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2024-10-22 22:25:52',1)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2024-10-22 22:25:52', userid = 1;
UPDATE product SET productName = 'مستر مروان 910', productDescription = '', productCatId = '1', productBuyPrice = '370.00', productSellAllPrice = '380.00', productSellUnitPrice = '380', productSellHalfPrice = '390.00', productDate = '2024-02-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '9553',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '370',meanbuyprice = '370.00',meanbuyprice_withDiscount = '370' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.11' , buyhalf_precentage = '10.81' , buypart_precentage = '21.62',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2024-10-22 22:25:55',1)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2024-10-22 22:25:55', userid = 1;
UPDATE product SET productName = 'مستر مروان 910', productDescription = '', productCatId = '1', productBuyPrice = '310', productSellAllPrice = '380.00', productSellUnitPrice = '380.00', productSellHalfPrice = '390.00', productDate = '2024-02-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '9553',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '370',meanbuyprice = '340',meanbuyprice_withDiscount = '340' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.11' , buyhalf_precentage = '10.81' , buypart_precentage = '21.62',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2024-10-22 22:25:59',1)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2024-10-22 22:25:59', userid = 1;
UPDATE product SET productName = 'مستر مروان 910', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310', productSellUnitPrice = '310', productSellHalfPrice = '310', productDate = '2024-02-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '9553',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '370',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.11' , buyhalf_precentage = '10.81' , buypart_precentage = '21.62',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2024-10-22 22:26:01',1)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2024-10-22 22:26:01', userid = 1;
UPDATE product SET productName = 'مستر مروان 910', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310.00', productSellUnitPrice = '310.00', productSellHalfPrice = '320', productDate = '2024-02-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '9553',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '370',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.11' , buyhalf_precentage = '10.81' , buypart_precentage = '21.62',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2024-10-22 22:26:04',1)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2024-10-22 22:26:04', userid = 1;
UPDATE product SET productName = 'مستر مروان 910', productDescription = '', productCatId = '1', productBuyPrice = '310.00', productSellAllPrice = '310.00', productSellUnitPrice = '380', productSellHalfPrice = '320.00', productDate = '2024-02-27', conditions = '0', userId = '1', limitamount = '0', parcode = '01589',type ='0', expireDate = '0' , dailyentryId = '9553',isService = '0',isOptic = '0',lastbuyprice = '370.00',lastbuyprice_withDiscount = '370',meanbuyprice = '340.00',meanbuyprice_withDiscount = '340' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '8.11' , buyhalf_precentage = '10.81' , buypart_precentage = '21.62',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1589';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1589, 1,'2024-10-22 22:26:35',1)
                ON DUPLICATE KEY UPDATE productid = 1589, edited = 1, sysdate = '2024-10-22 22:26:35', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:57:54";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:27:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:27:54', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '440', productDescription = '', productCatId = '1', productBuyPrice = '280', productSellAllPrice = '165.00', productSellUnitPrice = '195.00', productSellHalfPrice = '175.00', productDate = '2021-11-07', conditions = '0', userId = '1', limitamount = '0', parcode = '00067',type ='0', expireDate = '0' , dailyentryId = '67',isService = '0',isOptic = '0',lastbuyprice = '155.00',lastbuyprice_withDiscount = '155',meanbuyprice = '217.5',meanbuyprice_withDiscount = '217.5' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '67';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (67, 1,'2024-10-22 22:28:05',1)
                ON DUPLICATE KEY UPDATE productid = 67, edited = 1, sysdate = '2024-10-22 22:28:05', userid = 1;
UPDATE product SET productName = '440', productDescription = '', productCatId = '1', productBuyPrice = '280.00', productSellAllPrice = '290', productSellUnitPrice = '290', productSellHalfPrice = '290', productDate = '2021-11-07', conditions = '0', userId = '1', limitamount = '0', parcode = '00067',type ='0', expireDate = '0' , dailyentryId = '67',isService = '0',isOptic = '0',lastbuyprice = '155.00',lastbuyprice_withDiscount = '155',meanbuyprice = '217.50',meanbuyprice_withDiscount = '217.5' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '67';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (67, 1,'2024-10-22 22:28:08',1)
                ON DUPLICATE KEY UPDATE productid = 67, edited = 1, sysdate = '2024-10-22 22:28:08', userid = 1;
UPDATE product SET productName = '440', productDescription = '', productCatId = '1', productBuyPrice = '280.00', productSellAllPrice = '290.00', productSellUnitPrice = '290.00', productSellHalfPrice = '300', productDate = '2021-11-07', conditions = '0', userId = '1', limitamount = '0', parcode = '00067',type ='0', expireDate = '0' , dailyentryId = '67',isService = '0',isOptic = '0',lastbuyprice = '155.00',lastbuyprice_withDiscount = '155',meanbuyprice = '217.50',meanbuyprice_withDiscount = '217.5' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '67';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (67, 1,'2024-10-22 22:28:12',1)
                ON DUPLICATE KEY UPDATE productid = 67, edited = 1, sysdate = '2024-10-22 22:28:12', userid = 1;
UPDATE product SET productName = '440', productDescription = '', productCatId = '1', productBuyPrice = '280.00', productSellAllPrice = '290.00', productSellUnitPrice = '380', productSellHalfPrice = '300.00', productDate = '2021-11-07', conditions = '0', userId = '1', limitamount = '0', parcode = '00067',type ='0', expireDate = '0' , dailyentryId = '67',isService = '0',isOptic = '0',lastbuyprice = '155.00',lastbuyprice_withDiscount = '155',meanbuyprice = '217.50',meanbuyprice_withDiscount = '217.5' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '67';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (67, 1,'2024-10-22 22:28:35',1)
                ON DUPLICATE KEY UPDATE productid = 67, edited = 1, sysdate = '2024-10-22 22:28:35', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:58:45";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:28:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:28:45', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '416', productDescription = '', productCatId = '1', productBuyPrice = '270', productSellAllPrice = '175.00', productSellUnitPrice = '205.00', productSellHalfPrice = '185.00', productDate = '2021-12-20', conditions = '0', userId = '1', limitamount = '0', parcode = '00611',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '165.00',lastbuyprice_withDiscount = '165',meanbuyprice = '217.5',meanbuyprice_withDiscount = '217.5' , productbuypricereal = '165.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.06' , buyhalf_precentage = '12.12' , buypart_precentage = '24.24',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '611';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (611, 1,'2024-10-22 22:28:55',1)
                ON DUPLICATE KEY UPDATE productid = 611, edited = 1, sysdate = '2024-10-22 22:28:55', userid = 1;
UPDATE product SET productName = '416', productDescription = '', productCatId = '1', productBuyPrice = '270.00', productSellAllPrice = '280', productSellUnitPrice = '280', productSellHalfPrice = '280', productDate = '2021-12-20', conditions = '0', userId = '1', limitamount = '0', parcode = '00611',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '165.00',lastbuyprice_withDiscount = '165',meanbuyprice = '217.50',meanbuyprice_withDiscount = '217.5' , productbuypricereal = '165.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.06' , buyhalf_precentage = '12.12' , buypart_precentage = '24.24',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '611';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (611, 1,'2024-10-22 22:28:58',1)
                ON DUPLICATE KEY UPDATE productid = 611, edited = 1, sysdate = '2024-10-22 22:28:58', userid = 1;
UPDATE product SET productName = '416', productDescription = '', productCatId = '1', productBuyPrice = '270.00', productSellAllPrice = '280.00', productSellUnitPrice = '280.00', productSellHalfPrice = '290', productDate = '2021-12-20', conditions = '0', userId = '1', limitamount = '0', parcode = '00611',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '165.00',lastbuyprice_withDiscount = '165',meanbuyprice = '217.50',meanbuyprice_withDiscount = '217.5' , productbuypricereal = '165.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.06' , buyhalf_precentage = '12.12' , buypart_precentage = '24.24',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '611';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (611, 1,'2024-10-22 22:29:01',1)
                ON DUPLICATE KEY UPDATE productid = 611, edited = 1, sysdate = '2024-10-22 22:29:01', userid = 1;
UPDATE product SET productName = '416', productDescription = '', productCatId = '1', productBuyPrice = '270.00', productSellAllPrice = '280.00', productSellUnitPrice = '370', productSellHalfPrice = '290.00', productDate = '2021-12-20', conditions = '0', userId = '1', limitamount = '0', parcode = '00611',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '165.00',lastbuyprice_withDiscount = '165',meanbuyprice = '217.50',meanbuyprice_withDiscount = '217.5' , productbuypricereal = '165.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '6.06' , buyhalf_precentage = '12.12' , buypart_precentage = '24.24',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '611';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (611, 1,'2024-10-22 22:29:25',1)
                ON DUPLICATE KEY UPDATE productid = 611, edited = 1, sysdate = '2024-10-22 22:29:25', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 18:59:56";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:29:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:29:57', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE product SET productName = '470 طيور الجنه ', productDescription = '', productCatId = '1', productBuyPrice = '330.00', productSellAllPrice = '340.00', productSellUnitPrice = '410', productSellHalfPrice = '360.00', productDate = '2023-10-16', conditions = '0', userId = '1', limitamount = '0', parcode = '01464',type ='0', expireDate = '0' , dailyentryId = '8607',isService = '0',isOptic = '0',lastbuyprice = '330.00',lastbuyprice_withDiscount = '330',meanbuyprice = '330.00',meanbuyprice_withDiscount = '330' , productbuypricereal = '330.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.03' , buyhalf_precentage = '9.09' , buypart_precentage = '15.15',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0'  WHERE productId = '1464';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1464, 1,'2024-10-22 22:30:27',1)
                ON DUPLICATE KEY UPDATE productid = 1464, edited = 1, sysdate = '2024-10-22 22:30:27', userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:00:33";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:30:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2024-10-22 22:30:33', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:08:38";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:38:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2024-10-22 22:38:39', '1', 'add', '156.210.76.86', '', '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(2261,1,6,1172,3,'2024-10-22',1,0, '' ,0,0,0,0,0,'2024-10-22 22:38:39',0,'',@id,@optnum);
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4298';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1172, 0, 0
                    , 270.00, -3, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 270.00,
                        buyQuantity =buyQuantity+-3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "3*2024-10-22*270.00," WHERE transferproductid = 9306;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1172', '1', '3', '1', '9306', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-3', '1', '2024-10-22','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4323';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1172, 0, 0
                    , 270.00, 3, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+3, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1172', '6', '3', '0', '9306', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '3', '1', '2024-10-22','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', '1126', '5', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-5', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4097';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1126, 0, 0
                    , 210.00, -5, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 210.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2024-10-22*210.00," WHERE transferproductid = 9307;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1126', '1', '5', '1', '9307', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-5', '1', '2024-10-22','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4737';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1126, 0, 0
                    , 210.00, 5, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1126', '6', '5', '0', '9307', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '5', '1', '2024-10-22','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', '1183', '2', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4347';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1183, 0, 0
                    , 160.00, -2, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 160.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2024-10-22*160.00," WHERE transferproductid = 9308;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1183', '1', '2', '1', '9308', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-2', '1', '2024-10-22','0','0');
UPDATE storedetail SET  productquantity = '2', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4359';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1183, 0, 0
                    , 160.00, 2, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1183', '6', '2', '0', '9308', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '2', '1', '2024-10-22','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', '1162', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4240';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1162, 0, 0
                    , 270.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 270.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*270.00," WHERE transferproductid = 9309;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1162', '1', '1', '1', '9309', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2024-10-22','0','0');
UPDATE storedetail SET  productquantity = '3', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4270';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1162, 0, 0
                    , 270.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1162', '6', '1', '0', '9309', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '2.00', '3', '1', '2024-10-22','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', '1163', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4241';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1163, 0, 0
                    , 270.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 270.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*270.00," WHERE transferproductid = 9310;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1163', '1', '1', '1', '9310', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2024-10-22','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4271';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1163, 0, 0
                    , 270.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1163', '6', '1', '0', '9310', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '1', '1', '2024-10-22','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', '67', '2', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '67';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 67, 0, 0
                    , 155.00, -2, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 155.00,
                        buyQuantity =buyQuantity+-2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "2*2024-10-22*155.00," WHERE transferproductid = 9311;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('67', '1', '2', '1', '9311', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-2', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('67', '6', '2', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 67, 0, 0
                    , 155.00, 2, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+2, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('67', '6', '2', '0', '9311', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '2', '1', '2024-10-22','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', '611', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '1756';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 611, 0, 0
                    , 165.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 165.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*165.00," WHERE transferproductid = 9312;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('611', '1', '1', '1', '9312', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('611', '6', '1', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 611, 0, 0
                    , 165.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('611', '6', '1', '0', '9312', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '1', '1', '2024-10-22','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', '1464', '4', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-4', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '5380';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1464, 0, 0
                    , 330.00, -4, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 330.00,
                        buyQuantity =buyQuantity+-4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "4*2024-10-22*330.00," WHERE transferproductid = 9313;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1464', '1', '4', '1', '9313', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-4', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1464', '6', '4', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1464, 0, 0
                    , 330.00, 4, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+4, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1464', '6', '4', '0', '9313', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '4', '1', '2024-10-22','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', '1589', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '49', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '5798';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-05-02', 1, 1589, 0, 0
                    , 370.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-1, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-05-02*370.00," WHERE transferproductid = 9314;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1589', '1', '1', '1', '9314', 'تحويل منتجات من المخزن', 'storemovementController.php', '50.00', '49', '1', '2024-10-22','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '5808';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-05-02', 6, 1589, 0, 0
                    , 370.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1589', '6', '1', '0', '9314', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '1', '1', '2024-10-22','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', '1849', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '6609';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1849, 0, 0
                    , 290.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 290.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*290.00," WHERE transferproductid = 9315;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1849', '1', '1', '1', '9315', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '0', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1849', '6', '1', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1849, 0, 0
                    , 290.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1849', '6', '1', '0', '9315', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '1', '1', '2024-10-22','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', '1139', '5', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-5', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4161';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1139, 0, 0
                    , 220.00, -5, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 220.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2024-10-22*220.00," WHERE transferproductid = 9316;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1139', '1', '5', '1', '9316', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-5', '1', '2024-10-22','0','0');
UPDATE storedetail SET  productquantity = '5', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4180';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1139, 0, 0
                    , 220.00, 5, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1139', '6', '5', '0', '9316', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '5', '1', '2024-10-22','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', '129', '48', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-69', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '129';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 129, 0, 0
                    , 235.00, -48, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 235.00,
                        buyQuantity =buyQuantity+-48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "48*2024-10-22*235.00," WHERE transferproductid = 9317;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('129', '1', '48', '1', '9317', 'تحويل منتجات من المخزن', 'storemovementController.php', '-21.00', '-69', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('129', '6', '48', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 129, 0, 0
                    , 235.00, 48, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('129', '6', '48', '0', '9317', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '48', '1', '2024-10-22','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', '1847', '9', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '6607';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1847, 0, 0
                    , 330.00, -9, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 330.00,
                        buyQuantity =buyQuantity+-9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "9*2024-10-22*330.00," WHERE transferproductid = 9318;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1847', '1', '9', '1', '9318', 'تحويل منتجات من المخزن', 'storemovementController.php', '9.00', '0', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1847', '6', '9', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1847, 0, 0
                    , 330.00, 9, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+9, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1847', '6', '9', '0', '9318', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '9', '1', '2024-10-22','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', '1848', '10', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '6608';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1848, 0, 0
                    , 360.00, -10, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 360.00,
                        buyQuantity =buyQuantity+-10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "10*2024-10-22*360.00," WHERE transferproductid = 9319;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1848', '1', '10', '1', '9319', 'تحويل منتجات من المخزن', 'storemovementController.php', '10.00', '0', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1848', '6', '10', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1848, 0, 0
                    , 360.00, 10, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+10, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1848', '6', '10', '0', '9319', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '10', '1', '2024-10-22','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', '1490', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-2', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '5462';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1490, 0, 0
                    , 340.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 340.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*340.00," WHERE transferproductid = 9320;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1490', '1', '1', '1', '9320', 'تحويل منتجات من المخزن', 'storemovementController.php', '-1.00', '-2', '1', '2024-10-22','0','0');
UPDATE storedetail SET  productquantity = '7', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '6564';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1490, 0, 0
                    , 340.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1490', '6', '1', '0', '9320', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '6.00', '7', '1', '2024-10-22','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', '1491', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '5463';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1491, 0, 0
                    , 340.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 340.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*340.00," WHERE transferproductid = 9321;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1491', '1', '1', '1', '9321', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1491', '6', '1', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1491, 0, 0
                    , 340.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1491', '6', '1', '0', '9321', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '1', '1', '2024-10-22','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', '1454', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '5349';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1454, 0, 0
                    , 290.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 290.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*290.00," WHERE transferproductid = 9322;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1454', '1', '1', '1', '9322', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1454', '6', '1', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1454, 0, 0
                    , 290.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1454', '6', '1', '0', '9322', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '1', '1', '2024-10-22','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', '1845', '5', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '6605';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1845, 0, 0
                    , 320.00, -5, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 320.00,
                        buyQuantity =buyQuantity+-5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "5*2024-10-22*320.00," WHERE transferproductid = 9323;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1845', '1', '5', '1', '9323', 'تحويل منتجات من المخزن', 'storemovementController.php', '5.00', '0', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1845', '6', '5', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1845, 0, 0
                    , 320.00, 5, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+5, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1845', '6', '5', '0', '9323', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '5', '1', '2024-10-22','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', '1846', '8', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '6606';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1846, 0, 0
                    , 330.00, -8, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 330.00,
                        buyQuantity =buyQuantity+-8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "8*2024-10-22*330.00," WHERE transferproductid = 9324;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1846', '1', '8', '1', '9324', 'تحويل منتجات من المخزن', 'storemovementController.php', '8.00', '0', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1846', '6', '8', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1846, 0, 0
                    , 330.00, 8, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+8, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1846', '6', '8', '0', '9324', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '8', '1', '2024-10-22','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', '1137', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4158';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1137, 0, 0
                    , 190.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 190.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*190.00," WHERE transferproductid = 9325;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1137', '1', '1', '1', '9325', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1137', '6', '1', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1137, 0, 0
                    , 190.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1137', '6', '1', '0', '9325', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '1', '1', '2024-10-22','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', '1158', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4232';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1158, 0, 0
                    , 215.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 215.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*215.00," WHERE transferproductid = 9326;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1158', '1', '1', '1', '9326', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1158', '6', '1', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1158, 0, 0
                    , 215.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1158', '6', '1', '0', '9326', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '1', '1', '2024-10-22','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', '1844', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '6604';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1844, 0, 0
                    , 310.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 310.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*310.00," WHERE transferproductid = 9327;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1844', '1', '1', '1', '9327', 'تحويل منتجات من المخزن', 'storemovementController.php', '1.00', '0', '1', '2024-10-22','0','0');
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1844', '6', '1', '1', '2024-10-22');
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1844, 0, 0
                    , 310.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1844', '6', '1', '0', '9327', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '1', '1', '2024-10-22','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', '1182', '1', '2024-10-22', '1', '0','2261',null,null,'2024-10-22 22:38:39',null,'','0','hide','0','0','0');
UPDATE storedetail SET  productquantity = '-1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4346';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 1, 1182, 0, 0
                    , 260.00, -1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyprice = 260.00,
                        buyQuantity =buyQuantity+-1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
UPDATE storemovement SET  buyPricesHistoryBookData = "1*2024-10-22*260.00," WHERE transferproductid = 9328;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1182', '1', '1', '1', '9328', 'تحويل منتجات من المخزن', 'storemovementController.php', '0.00', '-1', '1', '2024-10-22','0','0');
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2024-10-22' WHERE storedetailid = '4358';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2024-10-22', 6, 1182, 0, 0
                    , 260.00, 1, 0, 0, 1, '2024-10-22 22:38:39')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+1, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2024-10-22 22:38:39' ;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1182', '6', '1', '0', '9328', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0.00', '1', '1', '2024-10-22','0','0');
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:08:40";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:38:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('storemovementController.php', '2024-10-22 22:38:40', '1', 'editshow', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:09:23";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:39:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:39:23', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:09:32";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:39:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('productController.php', '2024-10-22 22:39:32', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:14:55";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:44:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('settlementsaveController.php', '2024-10-22 22:44:55', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:15:36";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:45:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2024-10-22 22:45:36', '1', '', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:17:59";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:47:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2024-10-22 22:47:59', '1', 'add', '156.210.76.86', '', 'DESKTOP');
BEGIN;
INSERT INTO transfermoney (saveidfrom, saveidto, transfermoneyvalue, transfermoneydate, userid, conditions, dailyentryid , comment) VALUES ('6','9', '35000', '2024-10-22', '1', '0', '0','دفعة لمصنع همس كفر الدوار بيد جهاد');
UPDATE save SET  savecurrentvalue = '2800',  userid = '1' WHERE saveid = '6';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('37800.00','35000', '1', '6', 'تحويل امول الى الخزنة  [ الشيخ وليد ] ', '806', '2800', '2024-10-22 22:47:59', '1',  'transfermoneyController.php','0','');
UPDATE save SET  savecurrentvalue = '9460093',  userid = '1' WHERE saveid = '9';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('9425093.00','35000', '0', '9', 'تحويل امول من الخزنة  [ خزينة محل كفر الدوار ] ', '806', '9460093', '2024-10-22 22:47:59', '1',  'transfermoneyController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '35000', '35000', '2024-10-22', '1', '0', '0', '2024-10-22 22:47:59','اضافة تحويل من خزينة محل كفر الدوار الى الشيخ وليد','1','0','0');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11182', '156', '35000', '','0');
UPDATE accountstree SET name = 'الشيخ وليد', customName = 'الشيخ وليد', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-09', itemtype2 = '1', theValue = '9460093', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '156';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11182', '140', '35000', '','0');
UPDATE accountstree SET name = 'خزينة محل كفر الدوار', customName = 'خزينة محل كفر الدوار', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2021-11-07', itemtype2 = '1', theValue = '-2205597', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '140';
UPDATE transfermoney SET saveidfrom = '6', saveidto = '9', transfermoneyvalue = '35000.00', transfermoneydate = '2024-10-22', userid = '1', conditions = '0' , dailyentryid = '11182' , comment = 'دفعة لمصنع همس كفر الدوار بيد جهاد' WHERE transfermoneyid = '806';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:18:00";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:48:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2024-10-22 22:48:00', '1', 'sucess', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:18:02";
UPDATE user SET loginip = "156.210.76.86", lastactivetime = "2024-10-22 22:48:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('transfermoneyController.php', '2024-10-22 22:48:02', '1', 'show', '156.210.76.86', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:18:55";
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties;
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:19:32";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:49:32", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('index.php', '2024-10-22 22:49:32', '7', '', '197.192.202.225', '', '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 < "2024-10-22 19:19:32";
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 < "2024-10-22 19:19:41";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:49:41", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 22:49:41', '7', '', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:19:41";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:49:41", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 22:49:41', '7', '', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:20:36";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:50:36", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 22:50:36', '7', 'add', '197.192.202.225', '', 'DESKTOP');
BEGIN;
INSERT INTO expenses (expensestypeid, expensesname, expensesdetails, expensesValue, expensesdate, userid, conditions,costcenterid,saveid,dailyentryid,bankid,bankaccountid,checknum,productid) VALUES ('-1', 'رفعت', '', '100', '2024-10-22', '7', '0','-1','5','0','0','0','','0');
UPDATE save SET  savecurrentvalue = '6035',  userid = '7' WHERE saveid = '5';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note) VALUES ('6135.00','100', '1', '5', 'إضافة مصروف', '5565', '6035', '2024-10-22 22:50:36', '7',  'expensesController.php','0','');
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid) VALUES ( '100', '100', '2024-10-22', '7', '0', '0', '2024-10-22 22:50:36','اضافة اسم مصروف( رفعت )','1','0','-1');
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11183', '160', '100', '','0');
UPDATE accountstree SET name = '', customName = '', parent = '10', itemtype = '1', itemfrom = '0', notes = '', del = '1', userid = '1', mydate = '2021-12-01', itemtype2 = '1', theValue = '-4738005', theOrder = '0', layingOrder = '',reportid = '2' WHERE id = '160';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('11183', '139', '100', '','0');
UPDATE accountstree SET name = 'خزينة محل عبدالله', customName = 'خزينة محل عبدالله', parent = '20', itemtype = '3', itemfrom = '0', notes = '', del = '0', userid = '1', mydate = '2022-07-06', itemtype2 = '1', theValue = '-3490433', theOrder = '0', layingOrder = '',reportid = '0' WHERE id = '139';
UPDATE expenses SET expensestypeid = '-1', expensesname = 'رفعت', expensesdetails = '', expensesValue = '100.00', expensesdate = '2024-10-22', userid = '7', conditions = '0',saveid = '5' , dailyentryid = '11183', bankid = '0', bankaccountid = '0', checknum = '', productid = '0' WHERE expensesid = '5565';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:20:37";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:50:37", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 22:50:37', '7', 'sucess', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:20:39";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:50:39", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('expensesController.php', '2024-10-22 22:50:39', '7', 'show', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:20:45";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:50:45", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2024-10-22 22:50:45', '7', '', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:20:57";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:50:57", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 22:50:57', '7', 'addsellBill', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:20:57";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:50:57", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 22:50:57', '7', 'addsellBill', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:21:32";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:51:32", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('sellbillController.php', '2024-10-22 22:51:32', '7', 'addsellBill', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:21:39";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:51:39", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2024-10-22 22:51:39', '7', '', '197.192.202.225', '', 'DESKTOP');
UPDATE user SET loginip = "" WHERE lastactivetime < "2024-10-22 19:21:40";
UPDATE user SET loginip = "197.192.202.225", lastactivetime = "2024-10-22 22:51:40", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType) VALUES ('savedailyController.php', '2024-10-22 22:51:40', '7', '', '197.192.202.225', '', 'DESKTOP');
