UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 05:15:30";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE programsettings SET companyname = 'سنتر احمد العربي', address = 'ش الترعة البولاقيه - امام قسم شبرا - مول العتبه', specializtion = 'ملابس جملة', phone = '01064062900', faxnumber = '', email = '', website = '', logo = '4a754be7e82553f312ecf932e16cce7d.jpg', roundnumbers = '1', saveprinting = '1', deptprinting = '1', printingpapersize = '0', userid = '-1', showPreviousPrice = '0', parcode = '0', priceing = '0', lastprice = '0', searchvalue = '2',clientsearchvalue = '2', updateproductprice = '0', allowfinsldelete = '0', updateclientprice = '0', `partition` = '0', taxcard = '', commercialregistration = '', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '1', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2026-10-01',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='57a85883346811cbf7076a51c5bd887a2e96bf2df777a95668d34a3537aceedfe3f238b684c96d789642405e6f69293dbb311716d957a5ac40fe5570cf297eaf',allowdateedit = '0', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='0' , 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 = '0', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='last_discount',Profitevaluation='last_discount' , delivery='0',premiums = '1',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 = ',0,0,0,',earlyrepayment = '0',visaPay = '0',headerPrint='38e56bc84e0c8adff190ee376e986bbd.png',headerPrintSand='',printSand='0',makeDailyEntry='1',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='0',printfoot='',sellorder='0',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='83b7fcbc8ec5f6680b38c85c5097af3b8f9e24beb34e300c92da2aed73200ef3508d6b04b93e1301b69bf990665657d386b98aa70faa9951dfc2289ed943c6cd',associatedtags='0',commentClientChasis='0',dollarExType='64',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0'
                ,reviewRecords='',reviewRecordsLastDate='0000-00-00',showepayrestaurant='0',showSellAllPriceInStoreDetail='0' WHERE programsettingsid = '1';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 05:30:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:00:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:00:06', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2047
UPDATE programsettings SET companyname = 'سنتر احمد العربي', address = 'ش الترعة البولاقيه - امام قسم شبرا - مول العتبه', specializtion = 'ملابس جملة', phone = '01064062900', faxnumber = '', email = '', website = '', logo = '4a754be7e82553f312ecf932e16cce7d.jpg', roundnumbers = '1', saveprinting = '1', deptprinting = '1', printingpapersize = '0', userid = '-1', showPreviousPrice = '0', parcode = '0', priceing = '0', lastprice = '0', searchvalue = '2',clientsearchvalue = '2', updateproductprice = '0', allowfinsldelete = '0', updateclientprice = '0', `partition` = '0', taxcard = '', commercialregistration = '', costcenter = '1', clinic = '1', workshop = '1', transport = '1', manufacturing = '1', masterCopy = '0' , dailyentrydate = '2020-04-18' ,updatefiledate = '2026-10-02',workerbetweenstores = '1',workshoptimeout = '24',drivertimeout = '3',currancy = 'جنيه',serial='57a85883346811cbf7076a51c5bd887a2e96bf2df777a95668d34a3537aceedfe3f238b684c96d789642405e6f69293dbb311716d957a5ac40fe5570cf297eaf',allowdateedit = '0', clientcode = '1' ,clientserial = '1',timezone = 'Africa/Cairo' , expiredate ='1' , production ='1' , description='1' , service ='0' , 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 = '0', isCafe = '0' ,isRestaurent = '0' ,productDays = '0',thereIsRestTax = '0',restTaxVal = '0',restPrintLang = '0',taxNameFlag = '0',parcodeDigits = '5' ,specializedParcodeDigits = '7', clientDefaultDebtLimit = '10000' , clientDefaultDebtLimitControl = '0',usedParcode = '1' ,productbycodeimage = '' ,commentClient='تعليق على العميل ',Inventoryevaluation='last_discount',Profitevaluation='last_discount' , delivery='0',premiums = '1',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 = ',0,0,0,',earlyrepayment = '0',visaPay = '0',headerPrint='38e56bc84e0c8adff190ee376e986bbd.png',headerPrintSand='',printSand='0',makeDailyEntry='1',clientShowTawla='0',billRest='1',suppIsClientToo='0',isCarBill='0',expensesproduct='1',projectshownew='1',showparcode='0',changeBuyPriceChangeSellInBuyBillCtrl = '0',changeBuyPriceChangeSellInProductCtrl = '0',inventoryvaluation = '1',showBillCollectionSearch='0',incomeclient='1',showserial='1',editservice='1',showCurrency='0',qrerp='1',valueadded='0',qrcodesh='0',printfoot='',sellorder='0',numberprint='0',valueaddedbuy='0',simpleAddClientInBill='0',licenseNo='',maintenance='0',showPrevDiscount='0',vatvalueqr='0.13043479',imgprinthide='0',parcodeprinttype = 'C128A',parcodeprintwidth='160',parcodeprinttextsize='14',parcodeprintCurr='',sizecolorDigits='3',searchBarcodeInBill='0',allowMobileLogin='0',lanAllowType='0',wanAllowType='0',sendBillToRestaurant='0',obgyPharmacyGroups='',updateProUnitPricesOnPriceUpdate='0',ebill='0',valueaddeddiscount='0',clientdetail='1',showPrevPricesRet='0',showPrevDiscountRet='0',eunitInTax='',showStoreToDetail='0',showBuyPriceAtProductddl='0',specialexpenses='1',ratioshow='0',defaultUnitPriceAtBill='0',rulers='0',quantitynew='0',showBillOperationSearch='0',obygyFolder='',clientsell='0',
                preorderperiod='0',useListPrice='0',ebillclient='0',importproduct='0',realestateunits='0',expensesupplier='0',changeOrderproduct='0',searchlimit='0',typebill='',roundnumbersbilltotal='0',noOfDecimalPlacesBillTotal='0',dailyEntryCostprice='last_discount',storeRecieveType='0',clientPhoneReq='0',addServiceToBill='0',realestatedev='1',showprice4='0',showprice5='0',showprice6='0',showprice7='0',showprice8='0',showpriceall='1',showpricehalf='1',showpriceunit='1',showbillstatus='0',showbilldeliverydate='0',enablequantityfractions='0',addclienttoproduct='0',closingcustomeraccount='0',serial2='',
                shownameE='0',showprocode='0',showpartnumber='0',showtype='0',showcompany='0',showweight='0',showorigin='0',showhscode='0',showexpire='0',showgrantduration='0',showonline='0',showminappear='0',showonlinecat='0',showsellpercentage='0',showbuydiscount='0',preparingStore='1',sellordername='0',showsearchfilter='0',unitPriceAtsalesreport='0',medExCat='0',laterNakdiClientId='0',headerPrint12Right='',headerPrint12Left='',halfPriceStart='0',allPriceStart='0',checkretsellclient='1',webApiId='0',noBillEditTillPay='0',showDataOfficialContract='0',showprice9='0',showprice10='0',showprice11='0',showprice12='0',showprice13='0',serial3='83b7fcbc8ec5f6680b38c85c5097af3b8f9e24beb34e300c92da2aed73200ef3508d6b04b93e1301b69bf990665657d386b98aa70faa9951dfc2289ed943c6cd',associatedtags='0',commentClientChasis='0',dollarExType='64',saudielectronicinvoice='0',saudielectronicinvoclient='0',productDiscount='0'
                ,reviewRecords='',reviewRecordsLastDate='0000-00-00',showepayrestaurant='0',showSellAllPriceInStoreDetail='0' WHERE programsettingsid = '1';
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 05:30:06";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:00:06', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2048
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 05:30:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:00:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 09:00:37', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2049
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 05:30:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:00:39", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:00:39', '4', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2050
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 05:30:39";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-02 09:00:39", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:00:39', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2051
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 05:30:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:00:48", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 09:00:48', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2052
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 05:38:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:08:36", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:08:36', '4', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2053
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 05:38:37";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-02 09:08:37", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:08:37', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2054
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 05:38:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:08:44", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 09:08:44', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2055
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 05:44:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:14:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:14:40', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2056
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 05:44:40";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-02 09:14:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:14:40', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2057
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 05:44:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:14:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:14:40', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2058
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 05:44:40";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-02 09:14:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:14:40', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2059
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 05:44:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:14:48", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 09:14:48', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2060
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:10:25";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:10:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:40:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:40:28', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2061
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 06:10:28";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:40:28', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2062
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:10:29";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:40:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:40:29', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2063
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 06:10:29";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:40:29', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2064
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:10:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:40:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 09:40:33', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2065
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:16:38";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:16:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:46:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:46:42', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2066
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 06:16:42";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:46:42', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2067
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:16:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:46:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 09:46:50', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2068
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:18:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:48:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 09:48:08', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2069
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:18:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:48:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 09:48:55', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2070
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:20:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:50:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 09:50:34', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2071
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:21:24";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:21:24";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:21:26";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:51:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:51:26', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2072
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 06:21:26";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:51:26', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2073
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:21:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:51:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 09:51:33', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2074
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:22:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:52:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 09:52:31', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2075
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:22:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:52:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:52:32', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2076
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 06:22:32";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:52:32', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2077
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:22:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:52:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 09:52:34', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2078
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 06:22:34";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 09:52:34', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2079
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:23:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 09:53:13", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 09:53:13', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2080
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 06:36:51";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:06:51", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 10:06:51', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2081
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:00:29";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:30:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:30:29', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2082
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:14:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:44:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:44:03', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2083
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:14:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:44:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:44:07', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2084
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:16:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:46:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:46:58', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2085
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:18:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:48:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:48:47', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2086
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:20:30";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:50:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:50:30', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2087
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:21:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:51:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:51:18', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2088
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:23:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:53:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:53:46', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2089
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:23:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:53:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:53:50', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2090
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:24:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:54:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:54:50', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2091
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:24:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:54:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:54:55', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2092
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:27:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:57:02", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 10:57:02', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2093
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:27:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:57:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:57:21', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2094
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:28:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:58:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:58:50', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2095
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:28:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 10:58:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 10:58:53', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2096
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:31:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:01:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:01:37', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2097
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:32:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:02:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:02:47', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2098
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:39:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:09:50", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 11:09:50', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2099

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abf4bd894527
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 11:09:51', '06abf4bd894527', '1', '0.00', '0', '0', '1', '1675.00', '1675', '1675', '0', '1', '2026-10-02 11:09:51', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','1675','0','','0','0','1675','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=38
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','38', '0', '2026-10-02 11:09:51', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1675', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 11:09:51','0','0','',''); -- id=114
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('315','09799', '38', '21', '866', '5', '335', '1675', '0', '', '0', '2026-10-02 11:09:51', '866', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','335','1675','0','','0','0.00','0','0','0','0'); -- id=210
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 210;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (866, '2026-10-02', 1675, 1575, 1575
                    , 1575, 1575, 1575, 1575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1575, 1575, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1675, sellCostBuyPrice =sellCostBuyPrice+1575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1575
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1675, 1575, 1575
                    , 1575, 1575, 1575, 1575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1575, 1575, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1675, sellCostBuyPrice =sellCostBuyPrice+1575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1575
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '142', userid = '2', storedetaildate = '2026-10-02 11:09:51' WHERE storedetailid = '866';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('866', '1', '5', '1', '38', 'اضافة فاتورة مبيعات', 'sellbillController.php', '147', '142', '2', '2026-10-02 11:09:51','0','0'); -- id=1871
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '85835',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('84160','1675', '0', '2', 'اضافة فاتورة مبيعات', '38', '85835', '2026-10-02 11:09:51', '2',  'sellbillController.php','1','','0'); -- id=54
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1675', '1675', '2026-10-02', '2', '0', '0', '2026-10-02 11:09:51','اضافة فاتورة مبيعات رقم 38','1','0',null,'0','38','sellbillController.php?do=showDetail&sellbillid=38'); -- id=972
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('972', '419', '1675', '','0'); -- id=974
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '85835', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('972', '143', '1675', '','0'); -- id=972
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '423985', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1575', '1575', '2026-10-02', '2', '0', '0', '2026-10-02 11:09:51','اضافة فاتورة مبيعات رقم 38 - صرف البضاعة من المخزن','1','0',null,'0','38','sellbillController.php?do=showDetail&sellbillid=38'); -- id=973
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('973', '402', '1575', '','0'); -- id=975
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '412041.9', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('973', '382', '1575', '','0'); -- id=973
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15190152.1', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='972,0,973' where sellbillid=38;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 1675, 1575, 1575
                    , 1575, 1575, 1575, 1575
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1575, 1575, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1675, sellCostBuyPrice =sellCostBuyPrice+1575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1575
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1675, 1575, 1575
                    , 1575, 1575, 1575, 1575
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1575, 1575, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1675, sellCostBuyPrice =sellCostBuyPrice+1575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1575
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1675, 1575, 1575
                    , 1575, 1575, 1575, 1575, 1575, 1575)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1675, netSellCostBuyPrice = netSellCostBuyPrice+1575
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1575
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1575
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1575
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1575
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1575
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1575
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1575;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abf4bd894527 and sellbillId = 38 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 07:39:51";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:09:51", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 11:09:51', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2100
UPDATE user SET loginip = "" WHERE userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:14:40";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:14:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:44:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 11:44:43', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2101
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 08:14:43";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 11:44:43', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2102
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:14:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:44:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:44:46', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2103
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:19:46";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:19:46";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:19:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:49:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 11:49:49', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2104
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 08:19:49";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 11:49:49', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2105
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:21:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:51:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-02 11:51:00', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=2106
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:21:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:51:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:51:45', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2107
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:21:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:51:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:51:47', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2108
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:22:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:52:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-02 11:52:08', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=2109
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:22:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:52:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:52:19', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2110
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:22:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:52:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:52:36', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2111
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:22:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:52:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:52:38', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2112
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:23:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:53:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:53:02', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2113
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:23:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:53:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-02 11:53:13', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=2114
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:23:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:53:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:53:40', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2115
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:23:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:53:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:53:40', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2116
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:24:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:54:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:54:43', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2117
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:25:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:55:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:55:10', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2118
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:25:14";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:55:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:55:14', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2119
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:25:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:55:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:55:23', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2120
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:27:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:57:27", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 11:57:27', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=2121
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:27:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 11:57:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 11:57:34', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2122
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:44:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:14:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 12:14:11', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2123
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:46:36";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:46:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:16:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 12:16:39', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2124
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 08:46:39";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 12:16:39', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2125
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:46:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:16:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 12:16:42', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2126
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:48:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:18:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-02 12:18:06', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=2127
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:48:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:18:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 12:18:08', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2128
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:56:07";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:56:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:26:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 12:26:11', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2129
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 08:56:11";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 12:26:11', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2130
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 08:56:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:26:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 12:26:13', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2131
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:00:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:30:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 12:30:45', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2132
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 09:00:45";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-02 12:30:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 12:30:45', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2133
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:00:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:30:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 12:30:47', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2134
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:01:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:31:12", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 12:31:12', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2135
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 09:01:13";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-02 12:31:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 12:31:13', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2136
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:01:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:31:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 12:31:16', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=2137
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:04:14";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:04:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:34:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 12:34:17', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2138
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 09:04:17";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 12:34:17', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2139
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:04:24";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:34:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-02 12:34:24', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=2140
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:04:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:34:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 12:34:31', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2141
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:12:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 12:42:17", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 12:42:17', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2142
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:30:53";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:31:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 13:01:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 13:01:02', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2143
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 09:31:03";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-02 13:01:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 13:01:03', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2144
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:31:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 13:01:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 13:01:05', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2145
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:31:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 13:01:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 13:01:09', '2', 'showDetail', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=38'); -- id=2146
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:31:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 13:01:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 13:01:21', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2147
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:34:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 13:04:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 13:04:38', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2148

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abf80f1ab5ff
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 13:04:38', '06abf80f1ab5ff', '1', '0.00', '0', '0', '1', '42550.00', '42550', '42550', '0', '1', '2026-10-02 13:04:38', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '97' ,'0','','','','','-1','0','0','0','0','0','42550','0','','0','0','42550','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=39
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','39', '0', '2026-10-02 13:04:38', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '42550', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 13:04:38','0','0','',''); -- id=115
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 30;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('537.64','01336', '39', '8', '1336', '5', '565', '2825', '0', '', '0', '2026-10-02 13:04:38', '1336', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','30-5,','1','1','0','0','565','2825','0','','0','0.00','0','0','0','0'); -- id=211
UPDATE sellbilldetail SET  lastbuyprice = 545.00 , meanbuyprice = 545.00, lastbuyprice_withDiscount = 537.64, meanbuyprice_withDiscount = 537.64
        , lastbuyprice_withTax = 545, meanbuyprice_withTax = 545, lastbuyprice_withDiscountAndTax = 537.64
                where sellbilldetailid = 211;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1336, '2026-10-02', 2825, 2725, 2725
                    , 2725, 2688.2, 2688.2, 2688.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2725, 2725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2825, sellCostBuyPrice =sellCostBuyPrice+2725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2725, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2688.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2688.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2688.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2725
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 2825, 2725, 2725
                    , 2725, 2688.2, 2688.2, 2688.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2725, 2725, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2825, sellCostBuyPrice =sellCostBuyPrice+2725
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2725, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2725
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2688.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2688.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2688.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2725
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2725
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '1336';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1336', '1', '5', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '20', '2', '2026-10-02 13:04:38','0','0'); -- id=1872
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('475','09648', '39', '31', '996', '5', '495', '2475', '0', '', '0', '2026-10-02 13:04:38', '996', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','495','2475','0','','0','0.00','0','0','0','0'); -- id=212
UPDATE sellbilldetail SET  lastbuyprice = 475.00 , meanbuyprice = 475.00, lastbuyprice_withDiscount = 475.00, meanbuyprice_withDiscount = 475.00
        , lastbuyprice_withTax = 475, meanbuyprice_withTax = 475, lastbuyprice_withDiscountAndTax = 475
                where sellbilldetailid = 212;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (996, '2026-10-02', 2475, 2375, 2375
                    , 2375, 2375, 2375, 2375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2375, 2375, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2475, sellCostBuyPrice =sellCostBuyPrice+2375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2375
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2375
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 2475, 2375, 2375
                    , 2375, 2375, 2375, 2375
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2375, 2375, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2475, sellCostBuyPrice =sellCostBuyPrice+2375
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2375, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2375
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2375, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2375
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2375
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2375
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2375
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '996';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('996', '1', '5', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-02 13:04:38','0','0'); -- id=1873
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 25;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('591.9','01331', '39', '8', '1331', '5', '620', '3100', '0', '', '0', '2026-10-02 13:04:38', '1331', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','25-5,','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=213
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 591.90, meanbuyprice_withDiscount = 591.90
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 591.9
                where sellbilldetailid = 213;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1331, '2026-10-02', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3100, 3000, 3000
                    , 3000, 2959.5, 2959.5, 2959.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2959.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2959.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2959.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '1331';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1331', '1', '5', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-02 13:04:38','0','0'); -- id=1874
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 20;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('630','01340', '39', '28', '1340', '5', '650', '3250', '0', '', '0', '2026-10-02 13:04:38', '1340', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','20-5,','1','1','0','0','650','3250','0','','0','0.00','0','0','0','0'); -- id=214
UPDATE sellbilldetail SET  lastbuyprice = 630.00 , meanbuyprice = 630.00, lastbuyprice_withDiscount = 630.00, meanbuyprice_withDiscount = 630.00
        , lastbuyprice_withTax = 630, meanbuyprice_withTax = 630, lastbuyprice_withDiscountAndTax = 630
                where sellbilldetailid = 214;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1340, '2026-10-02', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3250, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '1340';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1340', '1', '5', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-02 13:04:38','0','0'); -- id=1875
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('580','08845', '39', '28', '920', '5', '600', '3000', '0', '', '0', '2026-10-02 13:04:38', '920', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','600','3000','0','','0','0.00','0','0','0','0'); -- id=215
UPDATE sellbilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 580, lastbuyprice_withDiscountAndTax = 580
                where sellbilldetailid = 215;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (920, '2026-10-02', 3000, 2900, 2900
                    , 2900, 2900, 2900, 2900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2900, 2900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3000, 2900, 2900
                    , 2900, 2900, 2900, 2900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2900, 2900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '920';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('920', '1', '5', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-02 13:04:38','0','0'); -- id=1876
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('550','09729', '39', '28', '947', '5', '570', '2850', '0', '', '0', '2026-10-02 13:04:38', '947', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','570','2850','0','','0','0.00','0','0','0','0'); -- id=216
UPDATE sellbilldetail SET  lastbuyprice = 550.00 , meanbuyprice = 550.00, lastbuyprice_withDiscount = 550.00, meanbuyprice_withDiscount = 550.00
        , lastbuyprice_withTax = 550, meanbuyprice_withTax = 550, lastbuyprice_withDiscountAndTax = 550
                where sellbilldetailid = 216;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (947, '2026-10-02', 2850, 2750, 2750
                    , 2750, 2750, 2750, 2750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2750, 2750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2850, sellCostBuyPrice =sellCostBuyPrice+2750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 2850, 2750, 2750
                    , 2750, 2750, 2750, 2750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2750, 2750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2850, sellCostBuyPrice =sellCostBuyPrice+2750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '19', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '947';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('947', '1', '5', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '19', '2', '2026-10-02 13:04:38','0','0'); -- id=1877
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('560','09443', '39', '28', '939', '5', '580', '2900', '0', '', '0', '2026-10-02 13:04:38', '939', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','580','2900','0','','0','0.00','0','0','0','0'); -- id=217
UPDATE sellbilldetail SET  lastbuyprice = 560.00 , meanbuyprice = 560.00, lastbuyprice_withDiscount = 560.00, meanbuyprice_withDiscount = 560.00
        , lastbuyprice_withTax = 560, meanbuyprice_withTax = 560, lastbuyprice_withDiscountAndTax = 560
                where sellbilldetailid = 217;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (939, '2026-10-02', 2900, 2800, 2800
                    , 2800, 2800, 2800, 2800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2800, 2800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2900, sellCostBuyPrice =sellCostBuyPrice+2800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 2900, 2800, 2800
                    , 2800, 2800, 2800, 2800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2800, 2800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2900, sellCostBuyPrice =sellCostBuyPrice+2800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '939';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('939', '1', '5', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-02 13:04:38','0','0'); -- id=1878
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 65;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('520','01367', '39', '19', '1367', '6', '540', '3240', '0', '', '0', '2026-10-02 13:04:38', '1367', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','65-6,','1','1','0','0','540','3240','0','','0','0.00','0','0','0','0'); -- id=218
UPDATE sellbilldetail SET  lastbuyprice = 520.00 , meanbuyprice = 520.00, lastbuyprice_withDiscount = 520.00, meanbuyprice_withDiscount = 520.00
        , lastbuyprice_withTax = 520, meanbuyprice_withTax = 520, lastbuyprice_withDiscountAndTax = 520
                where sellbilldetailid = 218;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1367, '2026-10-02', 3240, 3120, 3120
                    , 3120, 3120, 3120, 3120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 3120, 3120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3240, sellCostBuyPrice =sellCostBuyPrice+3120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3240, 3120, 3120
                    , 3120, 3120, 3120, 3120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3120, 3120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3240, sellCostBuyPrice =sellCostBuyPrice+3120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '67', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '1367';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1367', '1', '6', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '73', '67', '2', '2026-10-02 13:04:38','0','0'); -- id=1879
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('240','08412', '39', '6', '662', '6', '260', '1560', '0', '', '0', '2026-10-02 13:04:38', '662', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','260','1560','0','','0','0.00','0','0','0','0'); -- id=219
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 240.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 240.00
        , lastbuyprice_withTax = 240, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 219;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (662, '2026-10-02', 1560, 1440, 1440
                    , 1440, 1440, 1440, 1440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1440, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1560, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1560, 1440, 1440
                    , 1440, 1440, 1440, 1440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1440, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1560, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '662';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('662', '1', '6', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '24', '2', '2026-10-02 13:04:38','0','0'); -- id=1880
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','08595', '39', '84', '1315', '10', '220', '2200', '0', '', '0', '2026-10-02 13:04:38', '1315', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','220','2200','0','','0','0.00','0','0','0','0'); -- id=220
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 200
                where sellbilldetailid = 220;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1315, '2026-10-02', 2200, 2000, 2000
                    , 2000, 2000, 2000, 2000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2200, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 2200, 2000, 2000
                    , 2000, 2000, 2000, 2000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2000, 2000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2200, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '72', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '1315';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1315', '1', '10', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '82', '72', '2', '2026-10-02 13:04:38','0','0'); -- id=1881
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('315','09799', '39', '21', '866', '10', '335', '3350', '0', '', '0', '2026-10-02 13:04:38', '866', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','335','3350','0','','0','0.00','0','0','0','0'); -- id=221
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 221;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (866, '2026-10-02', 3350, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3350, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3350, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '132', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '866';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('866', '1', '10', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '142', '132', '2', '2026-10-02 13:04:38','0','0'); -- id=1882
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('280','09432', '39', '21', '860', '10', '300', '3000', '0', '', '0', '2026-10-02 13:04:38', '860', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','300','3000','0','','0','0.00','0','0','0','0'); -- id=222
UPDATE sellbilldetail SET  lastbuyprice = 280.00 , meanbuyprice = 280.00, lastbuyprice_withDiscount = 280.00, meanbuyprice_withDiscount = 280.00
        , lastbuyprice_withTax = 280, meanbuyprice_withTax = 280, lastbuyprice_withDiscountAndTax = 280
                where sellbilldetailid = 222;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (860, '2026-10-02', 3000, 2800, 2800
                    , 2800, 2800, 2800, 2800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 2800, 2800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3000, 2800, 2800
                    , 2800, 2800, 2800, 2800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2800, 2800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3000, sellCostBuyPrice =sellCostBuyPrice+2800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '240', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '860';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('860', '1', '10', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '250', '240', '2', '2026-10-02 13:04:38','0','0'); -- id=1883
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('420','07619', '39', '37', '1088', '20', '440', '8800', '0', '', '0', '2026-10-02 13:04:38', '1088', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','440','8800','0','','0','0.00','0','0','0','0'); -- id=223
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 420.00, meanbuyprice_withDiscount = 420.00
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where sellbilldetailid = 223;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1088, '2026-10-02', 8800, 8400, 8400
                    , 8400, 8400, 8400, 8400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8400, 8400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8800, sellCostBuyPrice =sellCostBuyPrice+8400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 8800, 8400, 8400
                    , 8400, 8400, 8400, 8400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8400, 8400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8800, sellCostBuyPrice =sellCostBuyPrice+8400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '2', storedetaildate = '2026-10-02 13:04:38' WHERE storedetailid = '1088';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1088', '1', '20', '1', '39', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '20', '2', '2026-10-02 13:04:38','0','0'); -- id=1884
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '128385',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('85835','42550', '0', '2', 'اضافة فاتورة مبيعات', '39', '128385', '2026-10-02 13:04:38', '2',  'sellbillController.php','1','','0'); -- id=55
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '42550', '42550', '2026-10-02', '2', '0', '0', '2026-10-02 13:04:38','اضافة فاتورة مبيعات رقم 39','1','0',null,'0','39','sellbillController.php?do=showDetail&sellbillid=39'); -- id=974
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('974', '419', '42550', '','0'); -- id=976
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '128385', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('974', '143', '42550', '','0'); -- id=974
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '466535', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '40532.7', '40532.7', '2026-10-02', '2', '0', '0', '2026-10-02 13:04:38','اضافة فاتورة مبيعات رقم 39 - صرف البضاعة من المخزن','1','0',null,'0','39','sellbillController.php?do=showDetail&sellbillid=39'); -- id=975
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('975', '402', '40532.7', '','0'); -- id=977
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '452574.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('975', '382', '40532.7', '','0'); -- id=975
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15149619.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='974,0,975' where sellbillid=39;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 42550, 40610, 40610
                    , 40610, 40532.7, 40532.7, 40532.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,40610, 40610, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+42550, sellCostBuyPrice =sellCostBuyPrice+40610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+40610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+40610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+40532.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+40532.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+40532.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+40610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+40610
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 42550, 40610, 40610
                    , 40610, 40532.7, 40532.7, 40532.7
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,40610, 40610, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+42550, sellCostBuyPrice =sellCostBuyPrice+40610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+40610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+40610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+40532.7, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+40532.7
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+40532.7
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+40610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+40610
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 42550, 40610, 40610
                    , 40610, 40532.7, 40532.7, 40532.7, 40610, 40610)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+42550, netSellCostBuyPrice = netSellCostBuyPrice+40610
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+40610
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+40610
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+40532.7
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+40532.7
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+40532.7
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+40610
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+40610;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abf80f1ab5ff and sellbillId = 39 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 09:34:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 13:04:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 13:04:38', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2149
UPDATE user SET loginip = "" WHERE userid = 2;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 11:56:35";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 11:56:36";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 11:56:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:26:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 15:26:38', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2150
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 11:56:38";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 15:26:38', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2151
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 11:56:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:26:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:26:44', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2152
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 11:57:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:27:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:27:28', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2153
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 11:57:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:27:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:27:54', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2154
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 11:59:16";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 11:59:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:29:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 15:29:19', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2155
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 11:59:19";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 15:29:20', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2156
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 11:59:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:29:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:29:31', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2157
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:00:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:30:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 15:30:54', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2158
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 12:00:54";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 15:30:54', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2159
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:01:06";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:31:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:31:06', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=2160
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:01:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:31:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:31:11', '1', 'uinuseproducts', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=uinuseproducts'); -- id=2161
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:01:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:31:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:31:11', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=sucess'); -- id=2162
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:01:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:31:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:31:13', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=2163
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:02:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:32:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-02 15:32:48', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=2164
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:03:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:33:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:33:47', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2165
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:04:22";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:34:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:34:22', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2166
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:04:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:34:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:34:40', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2167
UPDATE productunit SET proUnitSellAllPrice  = 330.00 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '300.00', productSellHalfPrice = '300.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '270.00',meanbuyprice_withDiscount = '270' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='270',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:35:01',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:35:01', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellHalfPrice = 330.00 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '300.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '270.00',meanbuyprice_withDiscount = '270' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='270',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:35:04',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:35:04', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellUnitPrice = 330.00 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '270.00',meanbuyprice_withDiscount = '270' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='270',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:35:07',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:35:07', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellAllPrice  = 330.00 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '270.00',meanbuyprice_withDiscount = '270' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='270',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:35:31',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:35:31', userid = 1; -- id=2043
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '270.00',meanbuyprice_withDiscount = '270' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='270',meanbuyprice_withTax='270',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:35:49',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:35:49', userid = 1; -- id=2043
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32400', '32400', '2026-10-02', '1', '0', '0', '2026-10-02 15:36:01','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (270.00) الى (540) و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=976
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('976', '382', '32400', '','0'); -- id=978
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15182019.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('976', '53', '32400', '','0'); -- id=976
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '33280', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 540 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '405',meanbuyprice_withDiscount = '405' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='405',meanbuyprice_withTax='405',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:01',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:01', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellUnitPrice = 660 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '330.00', productSellUnitPrice = '660', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='405',meanbuyprice_withTax='405',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:01',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:01', userid = 1; -- id=0
UPDATE productunit SET proUnitSellAllPrice  = 660 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '660', productSellUnitPrice = '660.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='405',meanbuyprice_withTax='405',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:01',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:01', userid = 1; -- id=0
UPDATE productunit SET proUnitSellHalfPrice = 660 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='405',meanbuyprice_withTax='405',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:01',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:01', userid = 1; -- id=0
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32400', '32400', '2026-10-02', '1', '0', '0', '2026-10-02 15:36:18','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (540.00) الى (270) و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=977
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('977', '53', '32400', '','0'); -- id=979
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '880', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('977', '382', '32400', '','0'); -- id=977
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15149619.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 270 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '337.5',meanbuyprice_withDiscount = '337.5' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='337.5',meanbuyprice_withTax='337.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:18',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:18', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellAllPrice  = 330 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '337.50',meanbuyprice_withDiscount = '337.5' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='337.5',meanbuyprice_withTax='337.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:20',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:20', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellHalfPrice = 330 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '660.00', productSellHalfPrice = '330', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '337.50',meanbuyprice_withDiscount = '337.5' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='337.5',meanbuyprice_withTax='337.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:23',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:23', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellUnitPrice = 330 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '337.50',meanbuyprice_withDiscount = '337.5' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='337.5',meanbuyprice_withTax='337.5',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:25',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:25', userid = 1; -- id=2043
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32400', '32400', '2026-10-02', '1', '0', '0', '2026-10-02 15:36:31','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (270.00) الى (540) و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=978
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('978', '382', '32400', '','0'); -- id=980
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15182019.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('978', '53', '32400', '','0'); -- id=978
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '33280', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 540 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '438.75',meanbuyprice_withDiscount = '438.75' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='438.75',meanbuyprice_withTax='438.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:31',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:31', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellHalfPrice = 660 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '660', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '438.75',meanbuyprice_withDiscount = '438.75' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='438.75',meanbuyprice_withTax='438.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:31',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:31', userid = 1; -- id=0
UPDATE productunit SET proUnitSellUnitPrice = 660 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '330.00', productSellUnitPrice = '660', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '438.75',meanbuyprice_withDiscount = '438.75' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='438.75',meanbuyprice_withTax='438.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:31',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:31', userid = 1; -- id=0
UPDATE productunit SET proUnitSellAllPrice  = 660 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '660', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '438.75',meanbuyprice_withDiscount = '438.75' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='438.75',meanbuyprice_withTax='438.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:31',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:31', userid = 1; -- id=0
UPDATE productunit SET proUnitBuyPrice  = 540 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '438.75',meanbuyprice_withDiscount = '438.75' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='438.75',meanbuyprice_withTax='438.75',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:34',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:34', userid = 1; -- id=2043
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32400', '32400', '2026-10-02', '1', '0', '0', '2026-10-02 15:36:43','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (540.00) الى (270) و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=979
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('979', '53', '32400', '','0'); -- id=981
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '880', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('979', '382', '32400', '','0'); -- id=979
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15149619.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 270 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '354.38',meanbuyprice_withDiscount = '354.38' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='354.38',meanbuyprice_withTax='354.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:43',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:43', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellAllPrice  = 660 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '660', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '354.38',meanbuyprice_withDiscount = '354.38' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='354.38',meanbuyprice_withTax='354.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:36:53',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:36:53', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellHalfPrice =  * productnumber WHERE productid = 1368;
UPDATE productunit SET proUnitSellUnitPrice =  * productnumber WHERE productid = 1368;
UPDATE productunit SET proUnitSellAllPrice  =  * productnumber  WHERE productid = 1368;
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32400', '32400', '2026-10-02', '1', '0', '0', '2026-10-02 15:37:04','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (270.00) الى () و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=980
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('980', '53', '32400', '','0'); -- id=982
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-31520', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('980', '382', '32400', '','0'); -- id=980
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15117219.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  =  * productnumber WHERE productid = 1368;
UPDATE productunit SET proUnitBuyPrice  = 270 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '354.38',meanbuyprice_withDiscount = '354.38' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='354.38',meanbuyprice_withTax='354.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:10',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:10', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellHalfPrice = 330 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '330', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '354.38',meanbuyprice_withDiscount = '354.38' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='354.38',meanbuyprice_withTax='354.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:10',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:10', userid = 1; -- id=0
UPDATE productunit SET proUnitSellUnitPrice = 330 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '660.00', productSellUnitPrice = '330', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '354.38',meanbuyprice_withDiscount = '354.38' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='354.38',meanbuyprice_withTax='354.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:10',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:10', userid = 1; -- id=0
UPDATE productunit SET proUnitSellAllPrice  = 330 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '354.38',meanbuyprice_withDiscount = '354.38' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='354.38',meanbuyprice_withTax='354.38',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:11',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:11', userid = 1; -- id=2043
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32400', '32400', '2026-10-02', '1', '0', '0', '2026-10-02 15:37:17','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (270.00) الى (540) و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=981
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('981', '382', '32400', '','0'); -- id=983
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15149619.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('981', '53', '32400', '','0'); -- id=981
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '880', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 540 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '447.19',meanbuyprice_withDiscount = '447.19' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='447.19',meanbuyprice_withTax='447.19',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:17',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:17', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellUnitPrice = 660 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '330.00', productSellUnitPrice = '660', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '447.19',meanbuyprice_withDiscount = '447.19' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='447.19',meanbuyprice_withTax='447.19',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:17',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:17', userid = 1; -- id=0
UPDATE productunit SET proUnitSellHalfPrice = 660 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '330.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '447.19',meanbuyprice_withDiscount = '447.19' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='447.19',meanbuyprice_withTax='447.19',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:17',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:17', userid = 1; -- id=0
UPDATE productunit SET proUnitSellAllPrice  = 660 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '660', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '447.19',meanbuyprice_withDiscount = '447.19' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='447.19',meanbuyprice_withTax='447.19',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:17',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:17', userid = 1; -- id=0
UPDATE productunit SET proUnitSellAllPrice  = 990 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '990', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '447.19',meanbuyprice_withDiscount = '447.19' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='447.19',meanbuyprice_withTax='447.19',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:18',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:18', userid = 1; -- id=2043
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32400', '32400', '2026-10-02', '1', '0', '0', '2026-10-02 15:37:18','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (540.00) الى (810) و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=982
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('982', '382', '32400', '','0'); -- id=984
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15182019.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('982', '53', '32400', '','0'); -- id=982
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '33280', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 810 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '810', productSellAllPrice = '990.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '628.6',meanbuyprice_withDiscount = '628.6' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='628.6',meanbuyprice_withTax='628.6',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:18',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:18', userid = 1; -- id=0
UPDATE productunit SET proUnitSellUnitPrice = 990 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '810.00', productSellAllPrice = '990.00', productSellUnitPrice = '990', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '628.60',meanbuyprice_withDiscount = '628.6' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='628.6',meanbuyprice_withTax='628.6',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:18',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:18', userid = 1; -- id=0
UPDATE productunit SET proUnitSellHalfPrice = 990 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '810.00', productSellAllPrice = '990.00', productSellUnitPrice = '990.00', productSellHalfPrice = '990', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '628.60',meanbuyprice_withDiscount = '628.6' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='628.6',meanbuyprice_withTax='628.6',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:18',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:18', userid = 1; -- id=0
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '97200', '97200', '2026-10-02', '1', '0', '0', '2026-10-02 15:37:22','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (810.00) الى () و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=983
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('983', '53', '97200', '','0'); -- id=985
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-63920', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('983', '382', '97200', '','0'); -- id=983
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15084819.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  =  * productnumber WHERE productid = 1368;
UPDATE productunit SET proUnitSellAllPrice  =  * productnumber  WHERE productid = 1368;
UPDATE productunit SET proUnitSellHalfPrice =  * productnumber WHERE productid = 1368;
UPDATE productunit SET proUnitSellUnitPrice =  * productnumber WHERE productid = 1368;
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '97200', '97200', '2026-10-02', '1', '0', '0', '2026-10-02 15:37:32','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (810.00) الى () و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=984
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('984', '53', '97200', '','0'); -- id=986
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-161120', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('984', '382', '97200', '','0'); -- id=984
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14987619.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  =  * productnumber WHERE productid = 1368;
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '64800', '64800', '2026-10-02', '1', '0', '0', '2026-10-02 15:37:32','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (810.00) الى (270) و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=985
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('985', '53', '64800', '','0'); -- id=987
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-225920', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('985', '382', '64800', '','0'); -- id=985
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14922819.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 270 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270', productSellAllPrice = '990.00', productSellUnitPrice = '990.00', productSellHalfPrice = '990.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '449.3',meanbuyprice_withDiscount = '449.3' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='449.3',meanbuyprice_withTax='449.3',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:32',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:32', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellAllPrice  = 330 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330', productSellUnitPrice = '990.00', productSellHalfPrice = '990.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '449.30',meanbuyprice_withDiscount = '449.3' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='449.3',meanbuyprice_withTax='449.3',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:32',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:32', userid = 1; -- id=0
UPDATE productunit SET proUnitSellUnitPrice = 330 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330', productSellHalfPrice = '990.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '449.30',meanbuyprice_withDiscount = '449.3' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='449.3',meanbuyprice_withTax='449.3',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:33',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:33', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellHalfPrice = 330 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '449.30',meanbuyprice_withDiscount = '449.3' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='449.3',meanbuyprice_withTax='449.3',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:33',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:33', userid = 1; -- id=0
UPDATE productunit SET proUnitSellUnitPrice = 660 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '660', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '449.30',meanbuyprice_withDiscount = '449.3' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='449.3',meanbuyprice_withTax='449.3',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:39',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:39', userid = 1; -- id=2043
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32400', '32400', '2026-10-02', '1', '0', '0', '2026-10-02 15:37:39','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (270.00) الى (540) و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=986
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('986', '382', '32400', '','0'); -- id=988
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14955219.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('986', '53', '32400', '','0'); -- id=986
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-193520', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 540 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540', productSellAllPrice = '330.00', productSellUnitPrice = '660.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '494.65',meanbuyprice_withDiscount = '494.65' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='494.65',meanbuyprice_withTax='494.65',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:39',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:39', userid = 1; -- id=0
UPDATE productunit SET proUnitSellHalfPrice = 660 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '330.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '494.65',meanbuyprice_withDiscount = '494.65' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='494.65',meanbuyprice_withTax='494.65',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:39',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:39', userid = 1; -- id=0
UPDATE productunit SET proUnitSellAllPrice  = 660 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '540.00', productSellAllPrice = '660', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '494.65',meanbuyprice_withDiscount = '494.65' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='494.65',meanbuyprice_withTax='494.65',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:39',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:39', userid = 1; -- id=0
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '32400', '32400', '2026-10-02', '1', '0', '0', '2026-10-02 15:37:45','تعديل منتج (جاكيت جلد قيص عبد العال ) السعر من (540.00) الى (270) و الكميه (120)','1','0',null,'0','1368','productController.php?do=edit&id=1368'); -- id=987
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('987', '53', '32400', '','0'); -- id=989
UPDATE accountstree SET name = 'فروقات اعاده تقييم بضاعه', customName = 'فروقات اعاده تقييم بضاعه', customNameEn = '', nameEn = '', parent = '147', accountNature = '1', theValue = '-225920', theOrder = '0', layingOrder = '4201', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '2', itemtype2 = '0', itemtype3 = '', userid = '-1', del = '0', sysdate = '2024-05-07 12:08:31' WHERE id = '53';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('987', '382', '32400', '','0'); -- id=987
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14922819.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
UPDATE productunit SET proUnitBuyPrice  = 270 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270', productSellAllPrice = '660.00', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '382.33',meanbuyprice_withDiscount = '382.33' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='382.33',meanbuyprice_withTax='382.33',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:45',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:45', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellAllPrice  = 330 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330', productSellUnitPrice = '660.00', productSellHalfPrice = '660.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '382.33',meanbuyprice_withDiscount = '382.33' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='382.33',meanbuyprice_withTax='382.33',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:47',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:47', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellHalfPrice = 330 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '660.00', productSellHalfPrice = '330', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '382.33',meanbuyprice_withDiscount = '382.33' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='382.33',meanbuyprice_withTax='382.33',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:49',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:49', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellUnitPrice = 330 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '382.33',meanbuyprice_withDiscount = '382.33' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='382.33',meanbuyprice_withTax='382.33',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:37:52',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:37:52', userid = 1; -- id=2043
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:07:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:37:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:37:57', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2168
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:08:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:38:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:38:12', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2169
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:08:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:38:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:38:18', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2170
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:08:31";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:08:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:38:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 15:38:34', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2171
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 12:08:34";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 15:38:34', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2172
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:08:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:38:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:38:54', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2173
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:09:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:39:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:39:31', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2174
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:10:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:40:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:40:19', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2175
UPDATE productunit SET proUnitBuyPrice  = 430.00 * productnumber WHERE productid = 1369;
UPDATE product SET productName = 'جاكيت بوكس هارلي عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '430.00', productSellAllPrice = '490.00', productSellUnitPrice = '470.00', productSellHalfPrice = '470.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01369',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430.00',lastbuyprice_withDiscount = '430',meanbuyprice = '430.00',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1369';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1369, 1,'2026-10-02 15:40:29',1)
                ON DUPLICATE KEY UPDATE productid = 1369, edited = 1, sysdate = '2026-10-02 15:40:29', userid = 1; -- id=2044
UPDATE productunit SET proUnitSellAllPrice  = 490 * productnumber  WHERE productid = 1369;
UPDATE product SET productName = 'جاكيت بوكس هارلي عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '430.00', productSellAllPrice = '490', productSellUnitPrice = '470.00', productSellHalfPrice = '470.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01369',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430.00',lastbuyprice_withDiscount = '430',meanbuyprice = '430.00',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1369';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1369, 1,'2026-10-02 15:40:44',1)
                ON DUPLICATE KEY UPDATE productid = 1369, edited = 1, sysdate = '2026-10-02 15:40:44', userid = 1; -- id=2044
UPDATE productunit SET proUnitSellHalfPrice = 490 * productnumber WHERE productid = 1369;
UPDATE product SET productName = 'جاكيت بوكس هارلي عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '430.00', productSellAllPrice = '490.00', productSellUnitPrice = '470.00', productSellHalfPrice = '490', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01369',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430.00',lastbuyprice_withDiscount = '430',meanbuyprice = '430.00',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1369';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1369, 1,'2026-10-02 15:40:52',1)
                ON DUPLICATE KEY UPDATE productid = 1369, edited = 1, sysdate = '2026-10-02 15:40:52', userid = 1; -- id=2044
UPDATE productunit SET proUnitSellUnitPrice = 490 * productnumber WHERE productid = 1369;
UPDATE product SET productName = 'جاكيت بوكس هارلي عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '430.00', productSellAllPrice = '490.00', productSellUnitPrice = '490', productSellHalfPrice = '490.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01369',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430.00',lastbuyprice_withDiscount = '430',meanbuyprice = '430.00',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1369';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1369, 1,'2026-10-02 15:41:03',1)
                ON DUPLICATE KEY UPDATE productid = 1369, edited = 1, sysdate = '2026-10-02 15:41:03', userid = 1; -- id=2044
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:11:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:41:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:41:48', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2176
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:11:51";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:41:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:41:51', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2177
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:13:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:43:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:43:03', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2178
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:13:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:43:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:43:31', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2179
UPDATE productunit SET proUnitSellHalfPrice = 500 * productnumber WHERE productid = 1370;
UPDATE product SET productName = 'جاكيت بوكس رفرف عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '440.00', productSellAllPrice = '500.00', productSellUnitPrice = '480.00', productSellHalfPrice = '500', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01370',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440.00',lastbuyprice_withDiscount = '440',meanbuyprice = '440.00',meanbuyprice_withDiscount = '440' , productbuypricereal = '440.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.09' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1370';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1370, 1,'2026-10-02 15:43:54',1)
                ON DUPLICATE KEY UPDATE productid = 1370, edited = 1, sysdate = '2026-10-02 15:43:54', userid = 1; -- id=2045
UPDATE productunit SET proUnitSellUnitPrice = 500 * productnumber WHERE productid = 1370;
UPDATE product SET productName = 'جاكيت بوكس رفرف عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '440.00', productSellAllPrice = '500.00', productSellUnitPrice = '500', productSellHalfPrice = '500.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01370',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440.00',lastbuyprice_withDiscount = '440',meanbuyprice = '440.00',meanbuyprice_withDiscount = '440' , productbuypricereal = '440.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.09' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1370';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1370, 1,'2026-10-02 15:44:11',1)
                ON DUPLICATE KEY UPDATE productid = 1370, edited = 1, sysdate = '2026-10-02 15:44:11', userid = 1; -- id=2045
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:14:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:44:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:44:44', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2180
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:15:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:45:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:45:03', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2181
UPDATE productunit SET proUnitSellAllPrice  = 500 * productnumber  WHERE productid = 1371;
UPDATE product SET productName = 'جاكيت بوكس فيت سوسته عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '420.00', productSellAllPrice = '500', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01371',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1371';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1371, 1,'2026-10-02 15:45:16',1)
                ON DUPLICATE KEY UPDATE productid = 1371, edited = 1, sysdate = '2026-10-02 15:45:16', userid = 1; -- id=2046
UPDATE productunit SET proUnitSellHalfPrice = 500 * productnumber WHERE productid = 1371;
UPDATE product SET productName = 'جاكيت بوكس فيت سوسته عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '420.00', productSellAllPrice = '500.00', productSellUnitPrice = '460.00', productSellHalfPrice = '500', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01371',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1371';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1371, 1,'2026-10-02 15:45:33',1)
                ON DUPLICATE KEY UPDATE productid = 1371, edited = 1, sysdate = '2026-10-02 15:45:33', userid = 1; -- id=2046
UPDATE productunit SET proUnitSellUnitPrice = 500 * productnumber WHERE productid = 1371;
UPDATE product SET productName = 'جاكيت بوكس فيت سوسته عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '420.00', productSellAllPrice = '500.00', productSellUnitPrice = '500', productSellHalfPrice = '500.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01371',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1371';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1371, 1,'2026-10-02 15:45:39',1)
                ON DUPLICATE KEY UPDATE productid = 1371, edited = 1, sysdate = '2026-10-02 15:45:39', userid = 1; -- id=2046
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:16:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:46:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:46:09', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2182
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:16:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:46:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:46:12', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2183
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:16:32";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:46:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:46:32', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2184
UPDATE productunit SET proUnitSellAllPrice  =  * productnumber  WHERE productid = 1373;
UPDATE productunit SET proUnitSellAllPrice  =  * productnumber  WHERE productid = 1372;
UPDATE productunit SET proUnitSellAllPrice  = 500.00 * productnumber  WHERE productid = 1371;
UPDATE product SET productName = 'جاكيت بوكس فيت سوسته عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '420.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01371',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1371';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1371, 1,'2026-10-02 15:47:01',1)
                ON DUPLICATE KEY UPDATE productid = 1371, edited = 1, sysdate = '2026-10-02 15:47:01', userid = 1; -- id=2046
UPDATE productunit SET proUnitSellAllPrice  =  * productnumber  WHERE productid = 1369;
UPDATE productunit SET proUnitSellAllPrice  =  * productnumber  WHERE productid = 1371;
UPDATE productunit SET proUnitSellAllPrice  =  * productnumber  WHERE productid = 1368;
UPDATE productunit SET proUnitSellAllPrice  =  * productnumber  WHERE productid = 1375;
UPDATE productunit SET proUnitSellHalfPrice =  * productnumber WHERE productid = 1374;
UPDATE productunit SET proUnitSellHalfPrice =  * productnumber WHERE productid = 1370;
UPDATE productunit SET proUnitSellHalfPrice =  * productnumber WHERE productid = 1373;
UPDATE productunit SET proUnitSellHalfPrice =  * productnumber WHERE productid = 1372;
UPDATE productunit SET proUnitSellHalfPrice =  * productnumber WHERE productid = 1371;
UPDATE productunit SET proUnitSellHalfPrice =  * productnumber WHERE productid = 1369;
UPDATE productunit SET proUnitSellHalfPrice =  * productnumber WHERE productid = 1368;
UPDATE productunit SET proUnitSellHalfPrice =  * productnumber WHERE productid = 1375;
UPDATE productunit SET proUnitSellAllPrice  =  * productnumber  WHERE productid = 1374;
UPDATE productunit SET proUnitSellAllPrice  =  * productnumber  WHERE productid = 1370;
UPDATE productunit SET proUnitSellUnitPrice =  * productnumber WHERE productid = 1374;
UPDATE productunit SET proUnitSellUnitPrice =  * productnumber WHERE productid = 1370;
UPDATE productunit SET proUnitSellUnitPrice =  * productnumber WHERE productid = 1373;
UPDATE productunit SET proUnitSellUnitPrice =  * productnumber WHERE productid = 1372;
UPDATE productunit SET proUnitSellUnitPrice =  * productnumber WHERE productid = 1371;
UPDATE productunit SET proUnitSellUnitPrice =  * productnumber WHERE productid = 1369;
UPDATE productunit SET proUnitSellUnitPrice =  * productnumber WHERE productid = 1368;
UPDATE productunit SET proUnitSellUnitPrice =  * productnumber WHERE productid = 1375;
UPDATE productunit SET proUnitSellAllPrice  = 330 * productnumber  WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330', productSellUnitPrice = '330.00', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '382.33',meanbuyprice_withDiscount = '382.33' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='382.33',meanbuyprice_withTax='382.33',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:49:05',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:49:05', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellHalfPrice = 330 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330.00', productSellHalfPrice = '330', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '382.33',meanbuyprice_withDiscount = '382.33' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='382.33',meanbuyprice_withTax='382.33',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:49:10',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:49:10', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellUnitPrice = 330 * productnumber WHERE productid = 1368;
UPDATE product SET productName = 'جاكيت جلد قيص عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '270.00', productSellAllPrice = '330.00', productSellUnitPrice = '330', productSellHalfPrice = '330.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01368',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '270.00',lastbuyprice_withDiscount = '270',meanbuyprice = '382.33',meanbuyprice_withDiscount = '382.33' , productbuypricereal = '270.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.11' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='270',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='382.33',meanbuyprice_withTax='382.33',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='270',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1368';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1368, 1,'2026-10-02 15:49:42',1)
                ON DUPLICATE KEY UPDATE productid = 1368, edited = 1, sysdate = '2026-10-02 15:49:42', userid = 1; -- id=2043
UPDATE productunit SET proUnitSellAllPrice  = 490 * productnumber  WHERE productid = 1369;
UPDATE product SET productName = 'جاكيت بوكس هارلي عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '430.00', productSellAllPrice = '490', productSellUnitPrice = '490.00', productSellHalfPrice = '490.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01369',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430.00',lastbuyprice_withDiscount = '430',meanbuyprice = '430.00',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1369';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1369, 1,'2026-10-02 15:49:47',1)
                ON DUPLICATE KEY UPDATE productid = 1369, edited = 1, sysdate = '2026-10-02 15:49:47', userid = 1; -- id=2044
UPDATE productunit SET proUnitSellHalfPrice = 490 * productnumber WHERE productid = 1369;
UPDATE product SET productName = 'جاكيت بوكس هارلي عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '430.00', productSellAllPrice = '490.00', productSellUnitPrice = '490.00', productSellHalfPrice = '490', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01369',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430.00',lastbuyprice_withDiscount = '430',meanbuyprice = '430.00',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1369';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1369, 1,'2026-10-02 15:49:51',1)
                ON DUPLICATE KEY UPDATE productid = 1369, edited = 1, sysdate = '2026-10-02 15:49:51', userid = 1; -- id=2044
UPDATE productunit SET proUnitSellUnitPrice = 490 * productnumber WHERE productid = 1369;
UPDATE product SET productName = 'جاكيت بوكس هارلي عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '430.00', productSellAllPrice = '490.00', productSellUnitPrice = '490', productSellHalfPrice = '490.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01369',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '430.00',lastbuyprice_withDiscount = '430',meanbuyprice = '430.00',meanbuyprice_withDiscount = '430' , productbuypricereal = '430.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='430',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='430',meanbuyprice_withTax='430',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='430',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1369';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1369, 1,'2026-10-02 15:50:01',1)
                ON DUPLICATE KEY UPDATE productid = 1369, edited = 1, sysdate = '2026-10-02 15:50:01', userid = 1; -- id=2044
UPDATE productunit SET proUnitSellAllPrice  = 500 * productnumber  WHERE productid = 1370;
UPDATE product SET productName = 'جاكيت بوكس رفرف عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '440.00', productSellAllPrice = '500', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01370',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440.00',lastbuyprice_withDiscount = '440',meanbuyprice = '440.00',meanbuyprice_withDiscount = '440' , productbuypricereal = '440.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.09' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1370';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1370, 1,'2026-10-02 15:50:07',1)
                ON DUPLICATE KEY UPDATE productid = 1370, edited = 1, sysdate = '2026-10-02 15:50:07', userid = 1; -- id=2045
UPDATE productunit SET proUnitSellHalfPrice = 500 * productnumber WHERE productid = 1370;
UPDATE product SET productName = 'جاكيت بوكس رفرف عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '440.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01370',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440.00',lastbuyprice_withDiscount = '440',meanbuyprice = '440.00',meanbuyprice_withDiscount = '440' , productbuypricereal = '440.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.09' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1370';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1370, 1,'2026-10-02 15:50:10',1)
                ON DUPLICATE KEY UPDATE productid = 1370, edited = 1, sysdate = '2026-10-02 15:50:10', userid = 1; -- id=2045
UPDATE productunit SET proUnitSellUnitPrice = 500 * productnumber WHERE productid = 1370;
UPDATE product SET productName = 'جاكيت بوكس رفرف عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '440.00', productSellAllPrice = '500.00', productSellUnitPrice = '500', productSellHalfPrice = '500.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01370',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440.00',lastbuyprice_withDiscount = '440',meanbuyprice = '440.00',meanbuyprice_withDiscount = '440' , productbuypricereal = '440.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.09' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='440',meanbuyprice_withTax='440',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='440',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1370';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1370, 1,'2026-10-02 15:50:27',1)
                ON DUPLICATE KEY UPDATE productid = 1370, edited = 1, sysdate = '2026-10-02 15:50:27', userid = 1; -- id=2045
UPDATE productunit SET proUnitSellAllPrice  = 480 * productnumber  WHERE productid = 1372;
UPDATE product SET productName = 'جاكيت بوكس فيت جيب عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '420.00', productSellAllPrice = '480', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01372',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1372';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1372, 1,'2026-10-02 15:50:57',1)
                ON DUPLICATE KEY UPDATE productid = 1372, edited = 1, sysdate = '2026-10-02 15:50:57', userid = 1; -- id=2047
UPDATE productunit SET proUnitSellHalfPrice = 480 * productnumber WHERE productid = 1372;
UPDATE product SET productName = 'جاكيت بوكس فيت جيب عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '420.00', productSellAllPrice = '480.00', productSellUnitPrice = '460.00', productSellHalfPrice = '480', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01372',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1372';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1372, 1,'2026-10-02 15:51:00',1)
                ON DUPLICATE KEY UPDATE productid = 1372, edited = 1, sysdate = '2026-10-02 15:51:00', userid = 1; -- id=2047
UPDATE productunit SET proUnitSellUnitPrice = 480 * productnumber WHERE productid = 1372;
UPDATE product SET productName = 'جاكيت بوكس فيت جيب عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '420.00', productSellAllPrice = '480.00', productSellUnitPrice = '480', productSellHalfPrice = '480.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01372',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1372';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1372, 1,'2026-10-02 15:51:13',1)
                ON DUPLICATE KEY UPDATE productid = 1372, edited = 1, sysdate = '2026-10-02 15:51:13', userid = 1; -- id=2047
UPDATE productunit SET proUnitSellAllPrice  = 470 * productnumber  WHERE productid = 1373;
UPDATE product SET productName = 'جاكيت بوكس فيت باجي عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '410.00', productSellAllPrice = '470', productSellUnitPrice = '450.00', productSellHalfPrice = '450.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01373',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410.00',lastbuyprice_withDiscount = '410',meanbuyprice = '410.00',meanbuyprice_withDiscount = '410' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.76' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1373';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1373, 1,'2026-10-02 15:51:19',1)
                ON DUPLICATE KEY UPDATE productid = 1373, edited = 1, sysdate = '2026-10-02 15:51:19', userid = 1; -- id=2048
UPDATE productunit SET proUnitSellHalfPrice = 470 * productnumber WHERE productid = 1373;
UPDATE product SET productName = 'جاكيت بوكس فيت باجي عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '410.00', productSellAllPrice = '470.00', productSellUnitPrice = '450.00', productSellHalfPrice = '470', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01373',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410.00',lastbuyprice_withDiscount = '410',meanbuyprice = '410.00',meanbuyprice_withDiscount = '410' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.76' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1373';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1373, 1,'2026-10-02 15:51:56',1)
                ON DUPLICATE KEY UPDATE productid = 1373, edited = 1, sysdate = '2026-10-02 15:51:56', userid = 1; -- id=2048
UPDATE productunit SET proUnitSellUnitPrice = 470 * productnumber WHERE productid = 1373;
UPDATE product SET productName = 'جاكيت بوكس فيت باجي عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '410.00', productSellAllPrice = '470.00', productSellUnitPrice = '470', productSellHalfPrice = '470.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01373',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410.00',lastbuyprice_withDiscount = '410',meanbuyprice = '410.00',meanbuyprice_withDiscount = '410' , productbuypricereal = '0.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.76' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='410',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='410',meanbuyprice_withTax='410',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='410',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1373';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1373, 1,'2026-10-02 15:52:08',1)
                ON DUPLICATE KEY UPDATE productid = 1373, edited = 1, sysdate = '2026-10-02 15:52:08', userid = 1; -- id=2048
UPDATE productunit SET proUnitSellAllPrice  = 450 * productnumber  WHERE productid = 1374;
UPDATE product SET productName = 'بوكس فيت اسود سوسته عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '390.00', productSellAllPrice = '450', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01374',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '390',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '390.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1374';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1374, 1,'2026-10-02 15:52:12',1)
                ON DUPLICATE KEY UPDATE productid = 1374, edited = 1, sysdate = '2026-10-02 15:52:12', userid = 1; -- id=2049
UPDATE productunit SET proUnitSellHalfPrice = 450 * productnumber WHERE productid = 1374;
UPDATE product SET productName = 'بوكس فيت اسود سوسته عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '390.00', productSellAllPrice = '450.00', productSellUnitPrice = '430.00', productSellHalfPrice = '450', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01374',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '390',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '390.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1374';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1374, 1,'2026-10-02 15:52:16',1)
                ON DUPLICATE KEY UPDATE productid = 1374, edited = 1, sysdate = '2026-10-02 15:52:16', userid = 1; -- id=2049
UPDATE productunit SET proUnitSellUnitPrice = 450 * productnumber WHERE productid = 1374;
UPDATE product SET productName = 'بوكس فيت اسود سوسته عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '390.00', productSellAllPrice = '450.00', productSellUnitPrice = '450', productSellHalfPrice = '450.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01374',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390.00',lastbuyprice_withDiscount = '390',meanbuyprice = '390.00',meanbuyprice_withDiscount = '390' , productbuypricereal = '390.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1374';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1374, 1,'2026-10-02 15:52:36',1)
                ON DUPLICATE KEY UPDATE productid = 1374, edited = 1, sysdate = '2026-10-02 15:52:36', userid = 1; -- id=2049
UPDATE productunit SET proUnitSellAllPrice  = 300 * productnumber  WHERE productid = 1375;
UPDATE product SET productName = 'قميص جلو سوسته عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '240.00', productSellAllPrice = '300', productSellUnitPrice = '270.00', productSellHalfPrice = '270.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01375',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240.00',lastbuyprice_withDiscount = '240',meanbuyprice = '240.00',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '12.50' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1375';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1375, 1,'2026-10-02 15:52:42',1)
                ON DUPLICATE KEY UPDATE productid = 1375, edited = 1, sysdate = '2026-10-02 15:52:42', userid = 1; -- id=2050
UPDATE productunit SET proUnitSellHalfPrice = 300 * productnumber WHERE productid = 1375;
UPDATE product SET productName = 'قميص جلو سوسته عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '270.00', productSellHalfPrice = '300', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01375',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240.00',lastbuyprice_withDiscount = '240',meanbuyprice = '240.00',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '12.50' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1375';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1375, 1,'2026-10-02 15:52:45',1)
                ON DUPLICATE KEY UPDATE productid = 1375, edited = 1, sysdate = '2026-10-02 15:52:45', userid = 1; -- id=2050
UPDATE productunit SET proUnitSellUnitPrice = 300 * productnumber WHERE productid = 1375;
UPDATE product SET productName = 'قميص جلو سوسته عبد العال ', productDescription = '', productCatId = '91', productBuyPrice = '240.00', productSellAllPrice = '300.00', productSellUnitPrice = '300', productSellHalfPrice = '300.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01375',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '240.00',lastbuyprice_withDiscount = '240',meanbuyprice = '240.00',meanbuyprice_withDiscount = '240' , productbuypricereal = '240.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '12.50' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='240',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='240',meanbuyprice_withTax='240',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='240',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1375';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1375, 1,'2026-10-02 15:52:49',1)
                ON DUPLICATE KEY UPDATE productid = 1375, edited = 1, sysdate = '2026-10-02 15:52:49', userid = 1; -- id=2050
UPDATE productunit SET proUnitSellAllPrice  = 500 * productnumber  WHERE productid = 1371;
UPDATE product SET productName = 'جاكيت بوكس فيت سوسته عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '420.00', productSellAllPrice = '500', productSellUnitPrice = '500.00', productSellHalfPrice = '500.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01371',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1371';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1371, 1,'2026-10-02 15:53:36',1)
                ON DUPLICATE KEY UPDATE productid = 1371, edited = 1, sysdate = '2026-10-02 15:53:36', userid = 1; -- id=2046
UPDATE productunit SET proUnitSellHalfPrice = 500 * productnumber WHERE productid = 1371;
UPDATE product SET productName = 'جاكيت بوكس فيت سوسته عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '420.00', productSellAllPrice = '500.00', productSellUnitPrice = '500.00', productSellHalfPrice = '500', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01371',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1371';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1371, 1,'2026-10-02 15:53:40',1)
                ON DUPLICATE KEY UPDATE productid = 1371, edited = 1, sysdate = '2026-10-02 15:53:40', userid = 1; -- id=2046
UPDATE productunit SET proUnitSellUnitPrice = 500 * productnumber WHERE productid = 1371;
UPDATE product SET productName = 'جاكيت بوكس فيت سوسته عبد العال', productDescription = '', productCatId = '91', productBuyPrice = '420.00', productSellAllPrice = '500.00', productSellUnitPrice = '500', productSellHalfPrice = '500.00', productDate = '2026-10-01', conditions = '0', userId = '1', limitamount = '0', parcode = '01371',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420.00',lastbuyprice_withDiscount = '420',meanbuyprice = '420.00',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.52' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='420',meanbuyprice_withTax='420',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='420',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1371';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1371, 1,'2026-10-02 15:56:04',1)
                ON DUPLICATE KEY UPDATE productid = 1371, edited = 1, sysdate = '2026-10-02 15:56:04', userid = 1; -- id=2046
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:28:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:58:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:58:31', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2185
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:28:34";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 15:58:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 15:58:34', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2186
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:30:18";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:30:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:00:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 16:00:21', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2187
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 12:30:22";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 16:00:22', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2188
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:30:25";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:00:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 16:00:25', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2189
UPDATE user SET loginip = "" WHERE userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:34:09";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:34:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:04:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 16:04:12', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2190
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 12:34:12";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 16:04:12', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2191
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:37:02";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:37:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:07:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 16:07:04', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2192
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 12:37:04";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 16:07:04', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2193
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:37:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:07:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 16:07:08', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2194
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:37:25";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:07:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 16:07:25', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=2195
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:37:29";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:07:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 16:07:29', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=2196
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:37:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:07:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-10-02 16:07:36', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php'); -- id=2197
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:37:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:07:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-10-02 16:07:36', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php?do=show'); -- id=2198
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:37:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:07:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-10-02 16:07:39', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php?do=show'); -- id=2199
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:37:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:07:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-10-02 16:07:46', '1', 'details', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php?do=details&id=13'); -- id=2200
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:37:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:07:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 16:07:49', '1', 'showbarcodebuybill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=13&type=2'); -- id=2201
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:45:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:15:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-02 16:15:53', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php'); -- id=2202
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:46:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:16:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-02 16:16:00', '1', 'supplierShow2', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php?do=supplierShow2'); -- id=2203
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:52:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:22:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-10-02 16:22:59', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=2204
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:53:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:23:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productBuyreportController.php', '2026-10-02 16:23:12', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productBuyreportController.php'); -- id=2205
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:53:25";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:23:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productBuyreportController.php', '2026-10-02 16:23:25', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productBuyreportController.php?do=show'); -- id=2206
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:53:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:23:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productBuyreportController.php', '2026-10-02 16:23:45', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productBuyreportController.php?do=show'); -- id=2207
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:54:09";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:54:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:24:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 16:24:12', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2208
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 12:54:12";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 16:24:12', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2209
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 12:54:14";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:24:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 16:24:14', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2210
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:00:27";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 16:30:27", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 16:30:27', '1', '', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2211
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 13:00:27";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 16:30:27', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2212
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:00:30";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:00:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:30:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userratereportController.php', '2026-10-02 16:30:38', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userratereportController.php'); -- id=2213
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:00:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:30:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('userratereportController.php', '2026-10-02 16:30:38', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/userratereportController.php?do=show'); -- id=2214
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:00:41";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 16:30:41", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 16:30:41', '1', 'show', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=show'); -- id=2215
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:00:47";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 16:30:47", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 16:30:47', '1', 'edit', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=edit&id=1'); -- id=2216
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:01:44";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 16:31:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 16:31:44', '1', 'edit', '105.206.114.114', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=edit&id=1'); -- id=2217
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:01:50";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:31:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('programsettingsController.php', '2026-10-02 16:31:50', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/programsettingsController.php'); -- id=2218
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:01:53";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 16:31:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-02 16:31:53', '1', '', '105.206.114.114', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=2219
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:03:36";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 16:33:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 16:33:36', '1', 'show', '105.206.114.114', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=show'); -- id=2220
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE usergroupadmin SET isallowed = 0 WHERE propertyid in(1,4,85);UPDATE relusergroupproperties SET propertyvalue = 0 WHERE usergroupid = 1 and propertyid in(1,4,85);;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:07:14";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:07:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:37:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 16:37:17', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2221
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 13:07:17";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-02 16:37:17", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 16:37:17', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2222
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:07:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:37:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 16:37:20', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2223
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:08:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:38:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 16:38:23', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2224

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfb390845b3
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 16:38:23', '06abfb390845b3', '1', '0.00', '0', '0', '1', '4925.00', '4925', '4925', '0', '1', '2026-10-02 16:38:23', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '15' ,'0','','','','','-1','0','0','0','0','0','4925','0','','0','0','4925','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=40
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','40', '0', '2026-10-02 16:38:23', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4925', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 16:38:23','0','0','',''); -- id=116
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('315','78068', '40', '19', '834', '5', '335', '1675', '0', '', '0', '2026-10-02 16:38:23', '834', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','335','1675','0','','0','0.00','0','0','0','0'); -- id=224
UPDATE sellbilldetail SET  lastbuyprice = 315.00 , meanbuyprice = 315.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 315, meanbuyprice_withTax = 315, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 224;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (834, '2026-10-02', 1675, 1575, 1575
                    , 1575, 1575, 1575, 1575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1575, 1575, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1675, sellCostBuyPrice =sellCostBuyPrice+1575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1575
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1675, 1575, 1575
                    , 1575, 1575, 1575, 1575
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1575, 1575, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1675, sellCostBuyPrice =sellCostBuyPrice+1575
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1575, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1575
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1575, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1575
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1575
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1575
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1575
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '2', storedetaildate = '2026-10-02 16:38:23' WHERE storedetailid = '834';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('834', '1', '5', '1', '40', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '20', '2', '2026-10-02 16:38:23','0','0'); -- id=1885
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('305','08778', '40', '19', '838', '10', '325', '3250', '0', '', '0', '2026-10-02 16:38:23', '838', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','325','3250','0','','0','0.00','0','0','0','0'); -- id=225
UPDATE sellbilldetail SET  lastbuyprice = 305.00 , meanbuyprice = 305.00, lastbuyprice_withDiscount = 305.00, meanbuyprice_withDiscount = 305.00
        , lastbuyprice_withTax = 305, meanbuyprice_withTax = 305, lastbuyprice_withDiscountAndTax = 305
                where sellbilldetailid = 225;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (838, '2026-10-02', 3250, 3050, 3050
                    , 3050, 3050, 3050, 3050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3050, 3050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3250, 3050, 3050
                    , 3050, 3050, 3050, 3050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3050, 3050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3250, sellCostBuyPrice =sellCostBuyPrice+3050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '45', userid = '2', storedetaildate = '2026-10-02 16:38:23' WHERE storedetailid = '838';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('838', '1', '10', '1', '40', 'اضافة فاتورة مبيعات', 'sellbillController.php', '55', '45', '2', '2026-10-02 16:38:23','0','0'); -- id=1886
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '133310',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('128385','4925', '0', '2', 'اضافة فاتورة مبيعات', '40', '133310', '2026-10-02 16:38:23', '2',  'sellbillController.php','1','','0'); -- id=56
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4925', '4925', '2026-10-02', '2', '0', '0', '2026-10-02 16:38:23','اضافة فاتورة مبيعات رقم 40','1','0',null,'0','40','sellbillController.php?do=showDetail&sellbillid=40'); -- id=988
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('988', '419', '4925', '','0'); -- id=990
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '133310', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('988', '143', '4925', '','0'); -- id=988
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '471460', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4625', '4625', '2026-10-02', '2', '0', '0', '2026-10-02 16:38:23','اضافة فاتورة مبيعات رقم 40 - صرف البضاعة من المخزن','1','0',null,'0','40','sellbillController.php?do=showDetail&sellbillid=40'); -- id=989
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('989', '402', '4625', '','0'); -- id=991
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '457199.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('989', '382', '4625', '','0'); -- id=989
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14918194.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='988,0,989' where sellbillid=40;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 4925, 4625, 4625
                    , 4625, 4625, 4625, 4625
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4625, 4625, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4925, sellCostBuyPrice =sellCostBuyPrice+4625
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4625, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4625
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4625, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4625
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4625
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4625
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4625
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 4925, 4625, 4625
                    , 4625, 4625, 4625, 4625
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4625, 4625, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4925, sellCostBuyPrice =sellCostBuyPrice+4625
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4625, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4625
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4625, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4625
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4625
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4625
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4625
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 4925, 4625, 4625
                    , 4625, 4625, 4625, 4625, 4625, 4625)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4925, netSellCostBuyPrice = netSellCostBuyPrice+4625
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4625
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4625
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4625
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4625
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4625
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4625
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4625;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfb390845b3 and sellbillId = 40 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:08:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:38:23", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 16:38:23', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2225
UPDATE usergroupadmin SET isallowed = 0 WHERE id = 120;UPDATE usergroupadmin SET isallowed = 0 WHERE id = 121;UPDATE usergroupadmin SET isallowed = 0 WHERE id = 122;UPDATE usergroupadmin SET isallowed = 0 WHERE id = 123;UPDATE usergroupadmin SET isallowed = 0 WHERE id = 124;UPDATE usergroupadmin SET isallowed = 1 WHERE id = 125;UPDATE usergroupadmin SET isallowed = 1 WHERE id = 495;;
UPDATE relusergroupproperties SET propertyvalue = 1 WHERE propertyid = 155;UPDATE relusergroupproperties SET propertyvalue = 1 WHERE propertyid = 561;UPDATE usergroupadmin SET isallowed = 0 WHERE propertyid in(1,4,85);UPDATE relusergroupproperties SET propertyvalue = 0 WHERE usergroupid = 1 and propertyid in(1,4,85);;
UPDATE relusergroupproperties SET propertyvalue = 0 where usergroupid = -1;
UPDATE user SET loginip = "" WHERE userid = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:11:09";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:41:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 16:41:09', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2226
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:11:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:41:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 16:41:39', '1', 'showNew', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showNew'); -- id=2227
UPDATE productunit SET proUnitSellAllPrice  = 250 * productnumber  WHERE productid = 1244;
UPDATE product SET productName = 'سوفت سيفن /ار', productDescription = '', productCatId = '71', productBuyPrice = '375.00', productSellAllPrice = '250', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '08144',type ='0', expireDate = '0' , dailyentryId = '599',isService = '0',isOptic = '0',lastbuyprice = '365.00',lastbuyprice_withDiscount = '365',meanbuyprice = '370.00',meanbuyprice_withDiscount = '370' , productbuypricereal = '365.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='365',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='8144',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='370',meanbuyprice_withTax='370',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='1',sellpercenttype='0',searchfiltersid='1',lastbuyprice_withDiscountAndTax='365',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1244';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1244, 1,'2026-10-02 16:41:44',1)
                ON DUPLICATE KEY UPDATE productid = 1244, edited = 1, sysdate = '2026-10-02 16:41:44', userid = 1; -- id=1889
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:11:50";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 16:41:50", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 16:41:50', '1', '', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2228
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 13:11:50";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 16:41:50', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2229
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:12:05";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 16:42:05", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 16:42:05', '1', 'show', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=show'); -- id=2230
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:12:14";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 16:42:14", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 16:42:14', '1', 'edit', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=edit&id=1'); -- id=2231
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:12:16";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:42:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientPayedDeptController.php', '2026-10-02 16:42:16', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientPayedDeptController.php'); -- id=2232
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:12:21";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:42:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-02 16:42:21', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=2233
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:13:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:43:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 16:43:00', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php'); -- id=2234
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:13:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:43:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 16:43:54', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=add'); -- id=2235
BEGIN;
CALL supplierInUse(25,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
UPDATE supplier SET  suppliercurrentDebt = '499825',suppliercurrentDebtInCurrency= '499825' , userid = '1', supplierdate = '26-10-02'   WHERE supplierid = '25';
UPDATE supplier SET  inUse = 0 where supplierid = 25;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8100', '8100', '2026-10-02', '1', '0', '0', '2026-10-02 16:43:54','تسوية عجز مورد بالخصم','1','0','0','0','0',''); -- id=990
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('990', '444', '8100', '','0'); -- id=992
UPDATE accountstree SET name = 'سيفن ار - مورد', customName = 'سيفن ار - مورد', customNameEn = 'سيفن ار - مورد', nameEn = 'سيفن ار - مورد', parent = '81', accountNature = '1', theValue = '-176250', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '444';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('990', '146', '8100', '','0'); -- id=990
UPDATE accountstree SET name = 'ايرادات الخصم المكتسب', customName = 'ايرادات الخصم المكتسب', customNameEn = 'Acquired Discount Revenues', nameEn = 'Acquired Discount Revenues', parent = '147', accountNature = '1', theValue = '5104141', theOrder = '0', layingOrder = '4203', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Other Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:41' WHERE id = '146';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('25', '507925.00', '8100', '1', 'تسوية عجز مورد بالخصم', '-1', '499825', '2026-10-02 16:43:54', '1', 'supplierDeficitController.php', 'خصم علي كود 8144 سوفت جبردين 60 قطعه', '990','', '0','1','1','8100','1','0','0','0','0',''); -- id=116
UPDATE supplierdebtchange SET supplierid = '25', supplierdebtchangebefore = '507925.00', supplierdebtchangeamount = '8100', supplierdebtchangetype = '1', processname = 'تسوية عجز مورد بالخصم', supplierdebtchangemodelid = '-1', supplierdebtchangeafter = '499825', supplierdebtchangedate = '2026-10-02 16:43:54', userid = '1', tablename = 'supplierDeficitController.php', comment = 'خصم علي كود 8144 سوفت جبردين 60 قطعه', dailyentryid = '990',saveid = '',currencyId='1',conversionFactor='1',payedInCurrency='8100',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='499825',debtchangamountInSupplierCurrency='8100',debtchangafterInSupplierCurrency='499825', paySerialNo='0',tagids='' WHERE supplierdebtchangeid = '116';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:13:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:43:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 16:43:54', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=sucess'); -- id=2236
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:13:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:43:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 16:43:55', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=show'); -- id=2237
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:14:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:44:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 16:44:02', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=show'); -- id=2238
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:14:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:44:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-02 16:44:47', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php'); -- id=2239
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:14:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:44:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-02 16:44:56', '1', 'supplierShow2', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php?do=supplierShow2'); -- id=2240
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:17:26";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:47:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 16:47:26', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2241

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfb3cf88070
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 16:47:26', '06abfb3cf88070', '1', '0.00', '0', '0', '1', '5120.00', '5120', '5120', '0', '1', '2026-10-02 16:47:26', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '20' ,'0','','','','','-1','0','0','0','0','0','5120','0','','0','0','5120','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=41
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','41', '0', '2026-10-02 16:47:26', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5120', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 16:47:26','0','0','',''); -- id=117
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','08144', '41', '71', '1244', '8', '250', '2000', '0', '', '0', '2026-10-02 16:47:26', '1244', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','250','2000','0','','0','0.00','0','0','0','0'); -- id=226
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 365
                where sellbilldetailid = 226;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1244, '2026-10-02', 2000, 3000, 2920
                    , 2960, 2920, 2960, 2920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2960, 2960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 2000, 3000, 2920
                    , 2960, 2920, 2960, 2920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2960, 2960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '52', userid = '2', storedetaildate = '2026-10-02 16:47:26' WHERE storedetailid = '1244';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1244', '1', '8', '1', '41', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '52', '2', '2026-10-02 16:47:26','0','0'); -- id=1887
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','i0001248', '41', '71', '1248', '12', '260', '3120', '0', '', '0', '2026-10-02 16:47:26', '1248', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','260','3120','0','','0','0.00','0','0','0','0'); -- id=227
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 227;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1248, '2026-10-02', 3120, 3000, 2880
                    , 2940, 2880, 2940, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 2940, 2940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3120, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2940
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3120, 3000, 2880
                    , 2940, 2880, 2940, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2940, 2940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3120, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2940
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2026-10-02 16:47:26' WHERE storedetailid = '1248';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1248', '1', '12', '1', '41', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '15', '2', '2026-10-02 16:47:26','0','0'); -- id=1888
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '138430',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('133310','5120', '0', '2', 'اضافة فاتورة مبيعات', '41', '138430', '2026-10-02 16:47:26', '2',  'sellbillController.php','1','','0'); -- id=57
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5120', '5120', '2026-10-02', '2', '0', '0', '2026-10-02 16:47:26','اضافة فاتورة مبيعات رقم 41','1','0',null,'0','41','sellbillController.php?do=showDetail&sellbillid=41'); -- id=991
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('991', '419', '5120', '','0'); -- id=993
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '138430', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('991', '143', '5120', '','0'); -- id=991
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '476580', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5800', '5800', '2026-10-02', '2', '0', '0', '2026-10-02 16:47:26','اضافة فاتورة مبيعات رقم 41 - صرف البضاعة من المخزن','1','0',null,'0','41','sellbillController.php?do=showDetail&sellbillid=41'); -- id=992
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('992', '402', '5800', '','0'); -- id=994
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '462999.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('992', '382', '5800', '','0'); -- id=992
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14912394.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='991,0,992' where sellbillid=41;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 5120, 6000, 5800
                    , 5900, 5800, 5900, 5800
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5900, 5900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5120, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 5120, 6000, 5800
                    , 5900, 5800, 5900, 5800
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5900, 5900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5120, sellCostBuyPrice =sellCostBuyPrice+6000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 5120, 6000, 5800
                    , 5900, 5800, 5900, 5800, 5900, 5900)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5120, netSellCostBuyPrice = netSellCostBuyPrice+6000
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5800
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5900
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5800
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5900
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5800
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5900
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5900;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfb3cf88070 and sellbillId = 41 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:17:26";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:47:26", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 16:47:26', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2242
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:18:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:48:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-02 16:48:23', '1', 'supplierShow2', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php?do=supplierShow2'); -- id=2243
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:19:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:49:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 16:49:19', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2244

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfb5eed1967
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 16:49:19', '06abfb5eed1967', '1', '0.00', '0', '0', '1', '3100.00', '3100', '3100', '0', '1', '2026-10-02 16:49:19', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','3100','0','','0','0','3100','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=42
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','42', '0', '2026-10-02 16:49:19', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3100', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 16:49:19','0','0','',''); -- id=118
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('600','09530', '42', '8', '735', '5', '620', '3100', '0', '', '0', '2026-10-02 16:49:19', '735', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','620','3100','0','','0','0.00','0','0','0','0'); -- id=228
UPDATE sellbilldetail SET  lastbuyprice = 600.00 , meanbuyprice = 600.00, lastbuyprice_withDiscount = 600.00, meanbuyprice_withDiscount = 600.00
        , lastbuyprice_withTax = 600, meanbuyprice_withTax = 600, lastbuyprice_withDiscountAndTax = 600
                where sellbilldetailid = 228;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (735, '2026-10-02', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '2', storedetaildate = '2026-10-02 16:49:19' WHERE storedetailid = '735';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('735', '1', '5', '1', '42', 'اضافة فاتورة مبيعات', 'sellbillController.php', '20', '15', '2', '2026-10-02 16:49:19','0','0'); -- id=1889
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '141530',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('138430','3100', '0', '2', 'اضافة فاتورة مبيعات', '42', '141530', '2026-10-02 16:49:19', '2',  'sellbillController.php','1','','0'); -- id=58
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3100', '3100', '2026-10-02', '2', '0', '0', '2026-10-02 16:49:19','اضافة فاتورة مبيعات رقم 42','1','0',null,'0','42','sellbillController.php?do=showDetail&sellbillid=42'); -- id=993
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('993', '419', '3100', '','0'); -- id=995
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '141530', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('993', '143', '3100', '','0'); -- id=993
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '479680', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3000', '3000', '2026-10-02', '2', '0', '0', '2026-10-02 16:49:19','اضافة فاتورة مبيعات رقم 42 - صرف البضاعة من المخزن','1','0',null,'0','42','sellbillController.php?do=showDetail&sellbillid=42'); -- id=994
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('994', '402', '3000', '','0'); -- id=996
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '465999.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('994', '382', '3000', '','0'); -- id=994
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14909394.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='993,0,994' where sellbillid=42;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3000, 3000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3100, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3100, 3000, 3000
                    , 3000, 3000, 3000, 3000, 3000, 3000)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3100, netSellCostBuyPrice = netSellCostBuyPrice+3000
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3000
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3000
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3000
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3000
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3000
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3000
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3000;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfb5eed1967 and sellbillId = 42 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:19:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:49:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 16:49:19', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2245
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:27:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:57:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 16:57:15', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=6'); -- id=2246
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:28:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:58:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 16:58:03', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=2247
BEGIN;
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,payedtax,costcenterid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06abfb83b84fd4', '2026-10-02 16:57:15', '59', '546030.00', '490030', '0', '0', '-56000.00', '-56000.00', '0', '-56000', '1', '2026-10-02 16:58:03', '', '1', '0', '', '1', '6','1','0.00','-1','0','1','0','0','0','0','0'); -- id=3
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('09426', '3', '58', '1203', '160', '350', '56000', '0', '', '1203','','','0','0','0','0','0','350','56000','0','0','0','0','0','0','0','1'); -- id=17
UPDATE product SET productName = 'وايد ليج جبردين بركان 370', productDescription = '', productCatId = '58', productBuyPrice = '350.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09426',type ='0', expireDate = '0' , dailyentryId = '558',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9426',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='1',sellpercenttype='0',searchfiltersid='1',lastbuyprice_withDiscountAndTax='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1203';
UPDATE returnbuybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 350, meanbuyprice_withDiscount = 350
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where returnbuybilldetailid = 17;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1203;
UPDATE storedetail SET  productquantity = '-11', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1203';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1203', '1', '160', '1', '3', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '149', '-11', '1', '2026-10-02 16:57:15','0','0'); -- id=1890
UPDATE supplier SET  suppliercurrentDebt = '86710',suppliercurrentDebtInCurrency= '490030' , userid = '1', supplierdate = '2026-10-02 16:58:03'   WHERE supplierid = '59';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('59', '142710.00', '56000', '1', 'اضافة فاتورة مردوات مشتريات', '3', '86710', '2026-10-02 16:57:15', '1', 'returnBuyBillController.php', 'اضافة فاتورة مردوات مشتريات', '0','', '0','1','1','56000','1','546030','56000','490030','0',''); -- id=117
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '56000', '56000', '2026-10-02', '1', '0', '0', '2026-10-02 16:58:03','اضافة فاتورة مردود مشتريات رقم 3','1','0',null,'0','3','returnBuyBillController.php?do=details&id=3'); -- id=995
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('995', '478', '56000', '','0'); -- id=997
UPDATE accountstree SET name = 'بركان - مورد', customName = 'بركان - مورد', customNameEn = 'بركان - مورد', nameEn = 'بركان - مورد', parent = '81', accountNature = '1', theValue = '-56000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '478';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('995', '382', '56000', '','0'); -- id=995
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14853394.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update returnbuybill set dailyentryid='995,0' where returnbuybillid=3;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:28:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:58:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-02 16:58:03', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=editprint&id=3'); -- id=2248
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:29:25";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:59:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-02 16:59:25', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=show'); -- id=2249
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:29:31";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:59:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-02 16:59:31', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=show'); -- id=2250
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:29:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:59:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 16:59:36', '1', 'editreturn', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editreturn&id=3'); -- id=2251
UPDATE productunit SET unitid = '1', productid = '1203', productnumber = '1.00', productunitdate = '2026-09-27', userid = '1', conditions = '0',proUnitParcode='',proUnitSellAllPrice='370',proUnitSellHalfPrice='0',proUnitSellUnitPrice ='0',proUnitBuyPrice='350',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1203';
UPDATE product SET productName = 'وايد ليج جبردين بركان 370', productDescription = '', productCatId = '58', productBuyPrice = '360', productSellAllPrice = '370', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09426',type ='0', expireDate = '0' , dailyentryId = '558',isService = '0',isOptic = '0',lastbuyprice = '350.00',lastbuyprice_withDiscount = '350',meanbuyprice = '350.00',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9426',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='1',sellpercenttype='0',searchfiltersid='1',lastbuyprice_withDiscountAndTax='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1203';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:29:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:59:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 16:59:47', '1', 'update', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=2252
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 4) and  modelid = 3;
UPDATE returnbuybill SET  returnbuybillsysdate = '2026-10-02 16:59:47', userid = null,delbyuserid = '1', conditions = '1' WHERE returnbuybillid = '3';
UPDATE returnbuybilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350.00, meanbuyprice_withTax = 350.00, lastbuyprice_withDiscountAndTax = 350.00
                where returnbuybilldetailid = 17;
UPDATE product SET productName = 'وايد ليج جبردين بركان 370', productDescription = '', productCatId = '58', productBuyPrice = '360.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09426',type ='0', expireDate = '0' , dailyentryId = '558',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9426',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='1',sellpercenttype='0',searchfiltersid='1',lastbuyprice_withDiscountAndTax='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1203';
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1203;
UPDATE storedetail SET  productquantity = '149', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1203';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1203', '1', '160', '0', '3', 'حذف فاتورة مردودات مشتريات', 'returnBuyBillController.php', '-11', '149', '1', '2026-10-02 16:57:15','0','0'); -- id=1891
UPDATE supplier SET  suppliercurrentDebt = '142710',suppliercurrentDebtInCurrency= '546030' , userid = '1', supplierdate = '2026-10-02 16:59:47'   WHERE supplierid = '59';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('59', '86710.00', '56000', '0', 'حذف فاتورة مردودات مشتريات', '3', '142710', '2026-10-02 16:57:15', '1', 'returnBuyBillController.php', 'حذف فاتورة مردودات مشتريات', '0','', '0','1','1','56000','1','490030','-56000','546030','0',''); -- id=118
UPDATE save SET  savecurrentvalue = '-1144750',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-1144750.00','0', '1', '1', 'حذف فاتورة مردودات مشتريات', '3', '-1144750', '2026-10-02 16:57:15', '1',  'returnBuyBillController.php','0','','0'); -- id=59
INSERT INTO returnbuybill (returnbuybillSerial, returnbuybilldate, returnbuybillsupplierid, returnbuybilltotaldeptbefor, returnbuybilltotaldeptafter, returnbuybilldiscount, returnbuybilldiscountrype, returnbuybilltotalbill, returnbuybillaftertotalbill, returnbuybilltotalpayed, returnbuybillfinalbill, returnbuybillstoreid, returnbuybillsysdate,comment, userid, conditions, returnbuybillclientname, returnbuybillsaveid, billnameid, returnbuybilldirectpayment,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,client,returnbuybilladdition,returnbuybilladditiontrype) VALUES ('06abfb83b84fd4', '2026-10-02 16:57:15', '59', '546030.00', '488430', '0', '0', '-57600.00', '-57600.00', '0.00', '-57600', '1', '2026-10-02 16:59:47', '', '1', '0', '', '1', '6' ,'1' ,'3','returnBuyBillController.php','0.00','-1','1','0','0','0','0','0'); -- id=4
INSERT INTO returnbuybilldetail (Parcode, returnbuybillid, returnbuybilldetailcatid, returnbuybilldetailproductid, returnbuybilldetailquantity, returnbuybilldetailprice, returnbuybilldetailtotalprice, discountvalue, note, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid, returnbuybilldetailpriceC, returnbuybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,lastbuyprice_withDiscountAndTax,storeid) VALUES ('09426', '4', '58', '1203', '160.00', '360', '57600', '0.00', '', '1203','','','0','0','0','0','0','360','57600','0','0','0','0','0','0','0','1'); -- id=18
UPDATE product SET productName = 'وايد ليج جبردين بركان 370', productDescription = '', productCatId = '58', productBuyPrice = '360.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '09426',type ='0', expireDate = '0' , dailyentryId = '558',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '359.36',meanbuyprice_withDiscount = '359.36' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='350',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='9426',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='360',meanbuyprice_withTax='359.36',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='1',sellpercenttype='0',searchfiltersid='1',lastbuyprice_withDiscountAndTax='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='1',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1203';
UPDATE returnbuybilldetail SET  lastbuyprice = 360 , meanbuyprice = 359.36, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 359.36
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 359.36, lastbuyprice_withDiscountAndTax = 360
                where returnbuybilldetailid = 18;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 1203;
UPDATE storedetail SET  productquantity = '-11', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1203';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1203', '1', '160', '1', '4', 'اضافة فاتورة مردودات مشتريات', 'returnBuyBillController.php', '149', '-11', '1', '2026-10-02 16:57:15','0','0'); -- id=1892
UPDATE supplier SET  suppliercurrentDebt = '85110',suppliercurrentDebtInCurrency= '488430' , userid = '1', supplierdate = '2026-10-02 16:59:47'   WHERE supplierid = '59';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('59', '142710.00', '57600', '1', 'اضافة فاتورة مردوات مشتريات', '4', '85110', '2026-10-02 16:57:15', '1', 'returnBuyBillController.php', 'اضافة فاتورة مردوات مشتريات', '0','', '0','1','1','56000','1','546030','57600','488430','0',''); -- id=119
UPDATE save SET  savecurrentvalue = '-1144750',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-1144750.00','0', '0', '1', 'اضافة فاتورة مردوات مشتريات', '4', '-1144750', '2026-10-02 16:57:15', '1',  'returnBuyBillController.php','0','','0'); -- id=60
UPDATE dailyentry SET totalcreditor = '56000.00', totaldebtor = '56000.00', thedate = '2026-10-02', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-02 16:58:03', entryComment = 'اضافة فاتورة مردود مشتريات رقم 3', fromFlag = '1',related='0',isopeningentry='0',operationId='3',operationDetailLink='returnBuyBillController.php?do=details&id=3' WHERE id = '995';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '56000.00', '56000.00', '2026-10-02', '1', '0', '995', '2026-10-02 16:59:47','تم عكس القيد رقم 995 ','1','0','0','0','0',''); -- id=996
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('996', '478', '56000.00', '','0'); -- id=996
UPDATE accountstree SET name = 'بركان - مورد', customName = 'بركان - مورد', customNameEn = 'بركان - مورد', nameEn = 'بركان - مورد', parent = '81', accountNature = '1', theValue = '0', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '478';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('996', '382', '56000.00', '','0'); -- id=998
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14909394.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '57600', '57600', '2026-10-02', '1', '0', '0', '2026-10-02 16:59:47','اضافة فاتورة مردود مشتريات رقم 4','1','0',null,'0','4','returnBuyBillController.php?do=details&id=4'); -- id=997
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('997', '478', '57600', '','0'); -- id=999
UPDATE accountstree SET name = 'بركان - مورد', customName = 'بركان - مورد', customNameEn = 'بركان - مورد', nameEn = 'بركان - مورد', parent = '81', accountNature = '1', theValue = '-57600', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '478';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('997', '382', '57600', '','0'); -- id=997
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14851794.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update returnbuybill set dailyentryid='997,0' where returnbuybillid=4;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:29:48";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 16:59:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-02 16:59:48', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=editprint&id=4'); -- id=2253
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:31:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:01:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 17:01:18', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php'); -- id=2254
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:31:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:01:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 17:01:43', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=add'); -- id=2255
BEGIN;
CALL supplierInUse(59,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
UPDATE supplier SET  suppliercurrentDebt = '70266',suppliercurrentDebtInCurrency= '70266' , userid = '1', supplierdate = '26-10-02'   WHERE supplierid = '59';
UPDATE supplier SET  inUse = 0 where supplierid = 59;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '14844', '14844', '2026-10-02', '1', '0', '0', '2026-10-02 17:01:43','تسوية عجز مورد بالخصم','1','0','0','0','0',''); -- id=998
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('998', '478', '14844', '','0'); -- id=1000
UPDATE accountstree SET name = 'بركان - مورد', customName = 'بركان - مورد', customNameEn = 'بركان - مورد', nameEn = 'بركان - مورد', parent = '81', accountNature = '1', theValue = '-72444', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 13:17:33' WHERE id = '478';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('998', '146', '14844', '','0'); -- id=998
UPDATE accountstree SET name = 'ايرادات الخصم المكتسب', customName = 'ايرادات الخصم المكتسب', customNameEn = 'Acquired Discount Revenues', nameEn = 'Acquired Discount Revenues', parent = '147', accountNature = '1', theValue = '5118985', theOrder = '0', layingOrder = '4203', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Other Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:41' WHERE id = '146';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('59', '85110.00', '14844', '1', 'تسوية عجز مورد بالخصم', '-1', '70266', '2026-10-02 17:01:43', '1', 'supplierDeficitController.php', '', '998','', '0','1','1','14844','1','0','0','0','0',''); -- id=120
UPDATE supplierdebtchange SET supplierid = '59', supplierdebtchangebefore = '85110.00', supplierdebtchangeamount = '14844', supplierdebtchangetype = '1', processname = 'تسوية عجز مورد بالخصم', supplierdebtchangemodelid = '-1', supplierdebtchangeafter = '70266', supplierdebtchangedate = '2026-10-02 17:01:43', userid = '1', tablename = 'supplierDeficitController.php', comment = '', dailyentryid = '998',saveid = '',currencyId='1',conversionFactor='1',payedInCurrency='14844',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='70266',debtchangamountInSupplierCurrency='14844',debtchangafterInSupplierCurrency='70266', paySerialNo='0',tagids='' WHERE supplierdebtchangeid = '120';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:31:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:01:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 17:01:43', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=sucess'); -- id=2256
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:31:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:01:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 17:01:44', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=show'); -- id=2257
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:31:56";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:01:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 17:01:56', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=show'); -- id=2258
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:31:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:01:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 17:01:58', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=show'); -- id=2259
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:32:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:02:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-02 17:02:05', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=show'); -- id=2260
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:35:24";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:05:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:05:24', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=2261
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:35:43";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:05:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:05:43', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2262
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:39:09";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:09:09", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 17:09:09', '1', 'edit', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=edit&id=1'); -- id=2263
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:40:40";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:10:40", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 17:10:40', '1', 'show', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=show'); -- id=2264
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:45:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:15:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 17:15:38', '2', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2265
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 13:45:38";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-02 17:15:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 17:15:38', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2266
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:45:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:15:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 17:15:40', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2267
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:46:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:16:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:16:53', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2268
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:47:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:17:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 17:17:07', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2269

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfbc8c6353e
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 17:17:07', '06abfbc8c6353e', '1', '0.00', '0', '0', '1', '1095.00', '1095', '1095', '0', '1', '2026-10-02 17:17:07', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1095','0','','0','0','1095','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=43
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','43', '0', '2026-10-02 17:17:07', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1095', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 17:17:07','0','0','',''); -- id=119
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('345','05030', '43', '97', '1395', '3', '365', '1095', '0', '', '0', '2026-10-02 17:17:07', '1395', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','365','1095','0','','0','0.00','0','0','0','0'); -- id=229
UPDATE sellbilldetail SET  lastbuyprice = 345.00 , meanbuyprice = 345.00, lastbuyprice_withDiscount = 345.00, meanbuyprice_withDiscount = 345.00
        , lastbuyprice_withTax = 345, meanbuyprice_withTax = 345, lastbuyprice_withDiscountAndTax = 345
                where sellbilldetailid = 229;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1395, '2026-10-02', 1095, 1035, 1035
                    , 1035, 1035, 1035, 1035
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1035, 1035, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1095, sellCostBuyPrice =sellCostBuyPrice+1035
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1035
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1035
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1035
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1035
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1035
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1095, 1035, 1035
                    , 1035, 1035, 1035, 1035
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1035, 1035, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1095, sellCostBuyPrice =sellCostBuyPrice+1035
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1035
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1035
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1035
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1035
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1035
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '112', userid = '2', storedetaildate = '2026-10-02 17:17:07' WHERE storedetailid = '1395';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1395', '1', '3', '1', '43', 'اضافة فاتورة مبيعات', 'sellbillController.php', '115', '112', '2', '2026-10-02 17:17:07','0','0'); -- id=1893
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '142625',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('141530','1095', '0', '2', 'اضافة فاتورة مبيعات', '43', '142625', '2026-10-02 17:17:07', '2',  'sellbillController.php','1','','0'); -- id=61
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1095', '1095', '2026-10-02', '2', '0', '0', '2026-10-02 17:17:07','اضافة فاتورة مبيعات رقم 43','1','0',null,'0','43','sellbillController.php?do=showDetail&sellbillid=43'); -- id=999
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('999', '419', '1095', '','0'); -- id=1001
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '142625', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('999', '143', '1095', '','0'); -- id=999
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '480775', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1035', '1035', '2026-10-02', '2', '0', '0', '2026-10-02 17:17:07','اضافة فاتورة مبيعات رقم 43 - صرف البضاعة من المخزن','1','0',null,'0','43','sellbillController.php?do=showDetail&sellbillid=43'); -- id=1000
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1000', '402', '1035', '','0'); -- id=1002
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '467034.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1000', '382', '1035', '','0'); -- id=1000
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14850759.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='999,0,1000' where sellbillid=43;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 1095, 1035, 1035
                    , 1035, 1035, 1035, 1035
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1035, 1035, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1095, sellCostBuyPrice =sellCostBuyPrice+1035
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1035
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1035
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1035
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1035
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1035
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1095, 1035, 1035
                    , 1035, 1035, 1035, 1035
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1035, 1035, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1095, sellCostBuyPrice =sellCostBuyPrice+1035
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1035
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1035
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1035
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1035
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1035
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1095, 1035, 1035
                    , 1035, 1035, 1035, 1035, 1035, 1035)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1095, netSellCostBuyPrice = netSellCostBuyPrice+1035
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1035
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1035
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1035
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1035
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1035
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1035
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1035;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfbc8c6353e and sellbillId = 43 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:47:07";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:17:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 17:17:07', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2270
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:47:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:17:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storetransferrequestController.php', '2026-10-02 17:17:23', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storetransferrequestController.php'); -- id=2271
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:49:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:19:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-10-02 17:19:46', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php'); -- id=2272
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:49:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:19:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-10-02 17:19:46', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php?do=show'); -- id=2273
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:49:53";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:19:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillreportController.php', '2026-10-02 17:19:53', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillreportController.php?do=show'); -- id=2274
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:50:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:20:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:20:10', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2275
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:50:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:20:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 17:20:27', '2', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2276

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfb65f5c63a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 17:20:27', '06abfb65f5c63a', '1', '0.00', '0', '0', '1', '4080.00', '4080', '4080', '0', '1', '2026-10-02 17:20:27', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '16' ,'0','','','','','-1','0','0','0','0','0','4080','0','','0','0','4080','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=44
UPDATE client SET  clientdebt = '0', userid = '2' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','44', '0', '2026-10-02 17:20:27', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4080', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 17:20:27','0','0','',''); -- id=120
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','i0001248', '44', '71', '1248', '8', '260', '2080', '0', '', '0', '2026-10-02 17:20:27', '1248', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','260','2080','0','','0','0.00','0','0','0','0'); -- id=230
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 230;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1248, '2026-10-02', 2080, 2000, 1920
                    , 1960, 1920, 1960, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 1960, 1960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2080, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 2080, 2000, 1920
                    , 1960, 1920, 1960, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1960, 1960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2080, sellCostBuyPrice =sellCostBuyPrice+2000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '7', userid = '2', storedetaildate = '2026-10-02 17:20:27' WHERE storedetailid = '1248';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1248', '1', '8', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '7', '2', '2026-10-02 17:20:27','0','0'); -- id=1894
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','08144', '44', '71', '1244', '8', '250', '2000', '0', '', '0', '2026-10-02 17:20:27', '1244', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','250','2000','0','','0','0.00','0','0','0','0'); -- id=231
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 365
                where sellbilldetailid = 231;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1244, '2026-10-02', 2000, 3000, 2920
                    , 2960, 2920, 2960, 2920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2960, 2960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 2000, 3000, 2920
                    , 2960, 2920, 2960, 2920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2960, 2960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '44', userid = '2', storedetaildate = '2026-10-02 17:20:27' WHERE storedetailid = '1244';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1244', '1', '8', '1', '44', 'اضافة فاتورة مبيعات', 'sellbillController.php', '52', '44', '2', '2026-10-02 17:20:27','0','0'); -- id=1895
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '146705',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('142625','4080', '0', '2', 'اضافة فاتورة مبيعات', '44', '146705', '2026-10-02 17:20:27', '2',  'sellbillController.php','1','','0'); -- id=62
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4080', '4080', '2026-10-02', '2', '0', '0', '2026-10-02 17:20:27','اضافة فاتورة مبيعات رقم 44','1','0',null,'0','44','sellbillController.php?do=showDetail&sellbillid=44'); -- id=1001
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1001', '419', '4080', '','0'); -- id=1003
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '146705', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1001', '143', '4080', '','0'); -- id=1001
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '484855', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4840', '4840', '2026-10-02', '2', '0', '0', '2026-10-02 17:20:27','اضافة فاتورة مبيعات رقم 44 - صرف البضاعة من المخزن','1','0',null,'0','44','sellbillController.php?do=showDetail&sellbillid=44'); -- id=1002
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1002', '402', '4840', '','0'); -- id=1004
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '471874.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1002', '382', '4840', '','0'); -- id=1002
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14845919.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='1001,0,1002' where sellbillid=44;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 4080, 5000, 4840
                    , 4920, 4840, 4920, 4840
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4080, sellCostBuyPrice =sellCostBuyPrice+5000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 4080, 5000, 4840
                    , 4920, 4840, 4920, 4840
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4080, sellCostBuyPrice =sellCostBuyPrice+5000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 4080, 5000, 4840
                    , 4920, 4840, 4920, 4840, 4920, 4920)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4080, netSellCostBuyPrice = netSellCostBuyPrice+5000
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4840
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4920
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4840
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4920
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4840
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4920
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4920;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfb65f5c63a and sellbillId = 44 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:50:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:20:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 17:20:28', '2', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2277
INSERT INTO supplier (suppliername, supplieraddress, supplierphone, suppliercurrentDebt, supplierdetails, conditions, userid, supplierdate, dailyentryid, category_id, typesupplier_id,linkedClientId,inUse,suppliercode,goverareaid,namepayeecheck,suppliermobile,warrantyOfficer,warrantymobile,sellername,sellermobile,taxnumber,supplierTypeForTree,treeId,sullpierCurrencyid,suppliercurrentDebtInCurrency,webApiId,shippingDiscountPer) VALUES ('محمد تريكو', '', '', '', '', '0', '1', '2026-10-02 17:22:07', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=80
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('80', '0', '', '0', 'إضافة مورد جديد', '80', '', '2026-10-02 17:22:07', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=121
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('محمد تريكو', 'محمد تريكو', 'محمد تريكو', 'محمد تريكو', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-10-02 17:22:07'); -- id=557
UPDATE supplier SET suppliername = 'محمد تريكو', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-02', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='557',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '80';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:52:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:22:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:22:18', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=2278
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06abfbd9ac93d6', '2026-10-02 17:20:10', '80', '0.00', '75520', '0', '0', '75520.00',  '75520.00', '', '75520', '1', '2026-10-02 17:22:18', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=24
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('01361', '24', '89', '1361', '48', '370', '17760.00', '0', '', '2026-10-02 17:22:18', '1361','','','0','0','0','0','0',null,'370','17760','0','0','0','0','0','0','0','0','1'); -- id=98
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02 17:20:10', 1, 1361, 0, 0
                    , 370, 48, 0, 0, 1, '2026-10-02 17:22:18')
                ON DUPLICATE KEY UPDATE buyprice = 370,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:22:18' ; -- id=121
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1361', '370', '48', '0', 'buyBillController.php', '98', '', '0', '0'); -- id=75
UPDATE product SET  productBuyPrice = "370" WHERE productId = 1361 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 98 ;
UPDATE product SET productName = 'فيندي حوض محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '370.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01361',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.81' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='370',meanbuyprice_withTax='370',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='370',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1361';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 370, meanbuyprice_withDiscount = 370
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where buybilldetailid = 98;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1361;
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1361';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1361', '1', '48', '0', '24', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '48', '1', '2026-10-02 17:20:10','0','0'); -- id=1896
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('01362', '24', '89', '1362', '32', '370', '11840.00', '0', '', '2026-10-02 17:22:18', '1362','','','0','0','0','0','0',null,'370','11840','0','0','0','0','0','0','0','0','1'); -- id=99
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02 17:20:10', 1, 1362, 0, 0
                    , 370, 32, 0, 0, 1, '2026-10-02 17:22:18')
                ON DUPLICATE KEY UPDATE buyprice = 370,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:22:18' ; -- id=122
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1362', '370', '32', '0', 'buyBillController.php', '99', '', '0', '0'); -- id=76
UPDATE product SET  productBuyPrice = "370" WHERE productId = 1362 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 99 ;
UPDATE product SET productName = 'برادا حوض محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '370.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01362',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.81' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='370',meanbuyprice_withTax='370',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='370',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1362';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 370, meanbuyprice_withDiscount = 370
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where buybilldetailid = 99;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 1362;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1362';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1362', '1', '32', '0', '24', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '1', '2026-10-02 17:20:10','0','0'); -- id=1897
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('01363', '24', '89', '1363', '32', '390', '12480.00', '0', '', '2026-10-02 17:22:18', '1363','','','0','0','0','0','0',null,'390','12480','0','0','0','0','0','0','0','0','1'); -- id=100
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02 17:20:10', 1, 1363, 0, 0
                    , 390, 32, 0, 0, 1, '2026-10-02 17:22:18')
                ON DUPLICATE KEY UPDATE buyprice = 390,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:22:18' ; -- id=123
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1363', '390', '32', '0', 'buyBillController.php', '100', '', '0', '0'); -- id=77
UPDATE product SET  productBuyPrice = "390" WHERE productId = 1363 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 100 ;
UPDATE product SET productName = 'شعيرات حوض محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '390.00', productSellAllPrice = '430.00', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01363',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '390',lastbuyprice_withDiscount = '390',meanbuyprice = '390',meanbuyprice_withDiscount = '390' , productbuypricereal = '390.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.26' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='390',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='390',meanbuyprice_withTax='390',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='390',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1363';
UPDATE buybilldetail SET  lastbuyprice = 390 , meanbuyprice = 390, lastbuyprice_withDiscount = 390, meanbuyprice_withDiscount = 390
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 390
                where buybilldetailid = 100;
UPDATE productunit SET proUnitBuyPrice  = 390 * productnumber WHERE productid = 1363;
UPDATE storedetail SET  productquantity = '32', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1363';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1363', '1', '32', '0', '24', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '1', '2026-10-02 17:20:10','0','0'); -- id=1898
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('01364', '24', '89', '1364', '48', '380', '18240.00', '0', '', '2026-10-02 17:22:18', '1364','','','0','0','0','0','0',null,'380','18240','0','0','0','0','0','0','0','0','1'); -- id=101
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02 17:20:10', 1, 1364, 0, 0
                    , 380, 48, 0, 0, 1, '2026-10-02 17:22:18')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:22:18' ; -- id=124
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1364', '380', '48', '0', 'buyBillController.php', '101', '', '0', '0'); -- id=78
UPDATE product SET  productBuyPrice = "380" WHERE productId = 1364 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 101 ;
UPDATE product SET productName = 'ديفرة نص سوسته محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '380.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01364',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.53' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1364';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 101;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 1364;
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1364';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1364', '1', '48', '0', '24', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '48', '1', '2026-10-02 17:20:10','0','0'); -- id=1899
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('01365', '24', '89', '1365', '40', '380', '15200.00', '0', '', '2026-10-02 17:22:18', '1365','','','0','0','0','0','0',null,'380','15200','0','0','0','0','0','0','0','0','1'); -- id=102
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02 17:20:10', 1, 1365, 0, 0
                    , 380, 40, 0, 0, 1, '2026-10-02 17:22:18')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:22:18' ; -- id=125
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1365', '380', '40', '0', 'buyBillController.php', '102', '', '0', '0'); -- id=79
UPDATE product SET  productBuyPrice = "380" WHERE productId = 1365 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 102 ;
UPDATE product SET productName = 'هاند ميد زراير محمد تريكو', productDescription = '', productCatId = '89', productBuyPrice = '380.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01365',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.53' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1365';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 102;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 1365;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1365';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1365', '1', '40', '0', '24', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-02 17:20:10','0','0'); -- id=1900
UPDATE supplier SET  suppliercurrentDebt = '75520',suppliercurrentDebtInCurrency= '75520' , userid = '1', supplierdate = '2026-10-02 17:22:18'   WHERE supplierid = '80';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('80', '0.00', '75520', '0', 'اضافة فاتورة مشتريات', '24', '75520', '2026-10-02 17:20:10', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','75520','1','0','75520','75520','0',''); -- id=122
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '75520', '75520', '2026-10-02', '1', '0', '0', '2026-10-02 17:22:18','اضافة فاتورة مشتريات رقم 24','1','0',null,'0','24','buyBillController.php?do=details&id=24'); -- id=1003
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1003', '382', '75520', '','0'); -- id=1005
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14921439.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1003', '557', '75520', '','0'); -- id=1003
UPDATE accountstree SET name = 'محمد تريكو', customName = 'محمد تريكو', customNameEn = 'محمد تريكو', nameEn = 'محمد تريكو', parent = '81', accountNature = '1', theValue = '75520', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-02 17:22:07' WHERE id = '557';
update buybill set dailyentryid='1003,0' where buybillid=24;
COMMIT;
UPDATE product SET overAllAveragePrice = 370 WHERE productId = 1361;UPDATE product SET overAllAveragePrice = 370 WHERE productId = 1362;UPDATE product SET overAllAveragePrice = 390 WHERE productId = 1363;UPDATE product SET overAllAveragePrice = 380 WHERE productId = 1364;UPDATE product SET overAllAveragePrice = 380 WHERE productId = 1365;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:52:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:22:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:22:18', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=24'); -- id=2279
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:52:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:22:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:22:37', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2280
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE usergroupadmin SET isallowed = 0 WHERE propertyid in(1,4,85);UPDATE relusergroupproperties SET propertyvalue = 0 WHERE usergroupid = 1 and propertyid in(1,4,85);;
INSERT INTO supplier (suppliername, supplieraddress, supplierphone, suppliercurrentDebt, supplierdetails, conditions, userid, supplierdate, dailyentryid, category_id, typesupplier_id,linkedClientId,inUse,suppliercode,goverareaid,namepayeecheck,suppliermobile,warrantyOfficer,warrantymobile,sellername,sellermobile,taxnumber,supplierTypeForTree,treeId,sullpierCurrencyid,suppliercurrentDebtInCurrency,webApiId,shippingDiscountPer) VALUES ('الجنتل', '', '', '', '', '0', '1', '2026-10-02 17:23:38', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=81
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('81', '0', '', '0', 'إضافة مورد جديد', '81', '', '2026-10-02 17:23:38', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=123
INSERT INTO accountstree (name, customName, customNameEn, nameEn, parent, accountNature, theValue, theOrder, layingOrder, reportid, listId, notes, itemfrom, itemtype, itemtype2, itemtype3, userid, del, sysdate) VALUES ('الجنتل', 'الجنتل', 'الجنتل', 'الجنتل', '81', '1', '0', '0', '', '1', '1', '', '0', '1', '1', '', '1', '0', '2026-10-02 17:23:38'); -- id=558
UPDATE supplier SET suppliername = 'الجنتل', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-02', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='558',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '81';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:53:40";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:23:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:23:40', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=2281
BEGIN;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,payedtax,costcenterid,dailyentryid,delbyuserid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06abfbe2dd15a8', '2026-10-02 17:22:37', '81', '0.00', '258900', '0', '0', '258900.00',  '258900.00', '', '258900', '1', '2026-10-02 17:23:41', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=25
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('01325', '25', '87', '1325', '414', '350', '144900.00', '0', '', '2026-10-02 17:23:41', '1325','','','0','0','0','0','0',null,'350','144900','0','0','0','0','0','0','0','0','1'); -- id=103
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02 17:22:37', 1, 1325, 0, 0
                    , 350, 414, 0, 0, 1, '2026-10-02 17:23:41')
                ON DUPLICATE KEY UPDATE buyprice = 350,
                        buyQuantity =buyQuantity+414, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:23:41' ; -- id=126
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1325', '350', '414', '0', 'buyBillController.php', '103', '', '0', '0'); -- id=80
UPDATE product SET  productBuyPrice = "350" WHERE productId = 1325 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 103 ;
UPDATE product SET productName = 'قطيفه الجنتل 390', productDescription = '', productCatId = '87', productBuyPrice = '350.00', productSellAllPrice = '390.00', productSellUnitPrice = '390.00', productSellHalfPrice = '390.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01325',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , 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',overAllAveragePrice='0',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='350',meanbuyprice_withTax='350',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='350',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1325';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 350, meanbuyprice_withDiscount = 350
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where buybilldetailid = 103;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1325;
UPDATE storedetail SET  productquantity = '414', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1325';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1325', '1', '414', '0', '25', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '414', '1', '2026-10-02 17:22:37','0','0'); -- id=1901
INSERT INTO buybilldetail (Parcode, buybillid, buybilldetailcatid, buybilldetailproductid, buybilldetailquantity, buybilldetailprice, buybilldetailtotalprice, discountvalue, note, buybilldetaildate, productunitid,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,quantitybefore, buybilldetailpriceC, buybilldetailtotalpriceC, discountvalueC,discounttype,rowtaxval,rowtaxper,lastbuyprice_withTax,meanbuyprice_withTax,probuyDiscountPer,lastbuyprice_withDiscountAndTax,storeid) VALUES ('01326', '25', '87', '1326', '300', '380', '114000.00', '0', '', '2026-10-02 17:23:41', '1326','','','0','0','0','0','0',null,'380','114000','0','0','0','0','0','0','0','0','1'); -- id=104
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02 17:22:37', 1, 1326, 0, 0
                    , 380, 300, 0, 0, 1, '2026-10-02 17:23:41')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+300, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:23:41' ; -- id=127
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1326', '380', '300', '0', 'buyBillController.php', '104', '', '0', '0'); -- id=81
UPDATE product SET  productBuyPrice = "380" WHERE productId = 1326 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 104 ;
UPDATE product SET productName = 'مشعر الجنتل 420', productDescription = '', productCatId = '87', productBuyPrice = '380.00', productSellAllPrice = '420.00', productSellUnitPrice = '420.00', productSellHalfPrice = '420.00', productDate = '2026-09-30', conditions = '0', userId = '1', limitamount = '0', parcode = '01326',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.53' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='0',weightedDiscount='0',sortby='0',TypeOfBarcodeInTax='GS1',itemsymbol='',barcodeInTax='',productNameE='',partNumber='0',vehicleType='0',company='0',weight='0',origin='',hscode='0',power='0',ProductionDate='',expiry='0',procode='',lastbuyprice_withTax='380',meanbuyprice_withTax='380',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='380',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1326';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 104;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 1326;
UPDATE storedetail SET  productquantity = '300', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1326';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1326', '1', '300', '0', '25', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '300', '1', '2026-10-02 17:22:37','0','0'); -- id=1902
UPDATE supplier SET  suppliercurrentDebt = '258900',suppliercurrentDebtInCurrency= '258900' , userid = '1', supplierdate = '2026-10-02 17:23:41'   WHERE supplierid = '81';
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('81', '0.00', '258900', '0', 'اضافة فاتورة مشتريات', '25', '258900', '2026-10-02 17:22:37', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','258900','1','0','258900','258900','0',''); -- id=124
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '258900', '258900', '2026-10-02', '1', '0', '0', '2026-10-02 17:23:41','اضافة فاتورة مشتريات رقم 25','1','0',null,'0','25','buyBillController.php?do=details&id=25'); -- id=1004
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1004', '382', '258900', '','0'); -- id=1006
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '15180339.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1004', '558', '258900', '','0'); -- id=1004
UPDATE accountstree SET name = 'الجنتل', customName = 'الجنتل', customNameEn = 'الجنتل', nameEn = 'الجنتل', parent = '81', accountNature = '1', theValue = '258900', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-02 17:23:38' WHERE id = '558';
update buybill set dailyentryid='1004,0' where buybillid=25;
COMMIT;
UPDATE product SET overAllAveragePrice = 350 WHERE productId = 1325;UPDATE product SET overAllAveragePrice = 380 WHERE productId = 1326;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:53:41";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:23:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:23:41', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=25'); -- id=2282
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:54:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:24:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-02 17:24:13', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=2283
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:54:15";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:24:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-02 17:24:15', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=2284
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:54:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:24:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-02 17:24:20', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=2285
UPDATE relusergroupproperties SET propertyvalue = 0 where usergroupid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:54:24";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:24:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-02 17:24:24', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=2286
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:54:39";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:24:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-02 17:24:39', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php'); -- id=2287
UPDATE user SET loginip = "" WHERE userid = 1;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:55:06";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:25:06", deviceType = "MOBILE" WHERE userid = -1;
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 13:55:06";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-02 17:25:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:55:24";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:25:24", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:55:28";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:25:28", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE userid = -1;
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:56:56";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:26:56", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 17:26:56', '1', '', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2288
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 13:56:56";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 17:26:56', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2289
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:57:02";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:27:02", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 17:27:02', '1', 'show', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=show'); -- id=2290
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:57:05";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:27:05", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 17:27:05', '1', 'edit', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=edit&id=1'); -- id=2291
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:57:09";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:27:09", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 17:27:09', '1', 'addsellBill', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=2292
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:57:16";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:27:16", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 17:27:16', '1', 'show', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=show'); -- id=2293
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:57:19";
UPDATE user SET loginip = "105.206.114.114", lastactivetime = "2026-10-02 17:27:19", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('usergroupController.php', '2026-10-02 17:27:19', '1', 'edit', '105.206.114.114', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/usergroupController.php?do=edit&id=1'); -- id=2294
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:57:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:27:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 17:27:38', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2295
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 13:57:38";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 17:27:38', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2296
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 13:57:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:27:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:27:42', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2297
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:08:47";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:38:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-02 17:38:47', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php'); -- id=2298
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:08:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:38:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-02 17:38:54', '1', 'supplierShow2', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php?do=supplierShow2'); -- id=2299
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:08:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:38:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:38:59', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=11'); -- id=2300
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:09:12";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:39:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:39:12', '1', 'showbarcodebuybill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=11&type=2'); -- id=2301
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:09:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:39:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:39:46', '1', 'showbarcodebuybill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=11&type=2'); -- id=2302
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:10:05";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:40:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:40:05', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=11'); -- id=2303
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:10:08";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:40:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:40:08', '1', 'bill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=2304
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:10:17";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:40:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-02 17:40:17', '1', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php'); -- id=2305
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:10:24";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:40:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsnewController.php', '2026-10-02 17:40:24', '1', 'supplierShow2', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsnewController.php?do=supplierShow2'); -- id=2306
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:10:29";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:40:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:40:29', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=11'); -- id=2307
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:10:33";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:40:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:40:33', '1', 'showbarcodebuybill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=11&type=2'); -- id=2308
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:10:51";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:40:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:40:51', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2309
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:10:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:40:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-02 17:40:57', '1', 'editprint', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=11'); -- id=2310
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:10:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:40:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:40:59', '1', 'showbarcodebuybill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=11&type=2'); -- id=2311
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:11:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:41:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:41:23', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2312
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:11:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:41:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:41:44', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2313
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:12:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:42:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:42:04', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2314
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:12:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:42:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:42:20', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2315
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:12:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:42:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-02 17:42:38', '1', 'showbarcode', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=2316
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:13:44";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:43:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-02 17:43:44', '1', 'add', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=add'); -- id=2317
BEGIN;
CALL insertUniqueOptNum(1,1,2,1323,770,'2026-10-02',1,0, '' , '' ,0,0,0,0,0,'2026-10-02 17:43:44',0,'',0,'','hide',0,@id,@optnum);
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1323';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-01', 1, 1323, 0, 0
                    , 305.00, 770, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-770, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=66
UPDATE storemovement SET  buyPricesHistoryBookData = "770*2026-10-01*305.00," WHERE transferproductid = 1;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1323', '1', '770', '1', '1', 'تحويل منتجات من المخزن', 'storemovementController.php', '770', '0', '1', '2026-10-02','0','0'); -- id=1903
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1323', '2', '770', '1', '2026-10-02'); -- id=1404
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-01', 2, 1323, 0, 0
                    , 305.00, 770, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+770, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=129
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1323', '2', '770', '0', '1', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '770', '1', '2026-10-02','0','0'); -- id=1904
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1324', '800', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=2
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1324';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-01', 1, 1324, 0, 0
                    , 350.00, 800, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-800, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=67
UPDATE storemovement SET  buyPricesHistoryBookData = "800*2026-10-01*350.00," WHERE transferproductid = 2;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1324', '1', '800', '1', '2', 'تحويل منتجات من المخزن', 'storemovementController.php', '800', '0', '1', '2026-10-02','0','0'); -- id=1905
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1324', '2', '800', '1', '2026-10-02'); -- id=1405
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-01', 2, 1324, 0, 0
                    , 350.00, 800, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+800, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=131
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1324', '2', '800', '0', '2', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '800', '1', '2026-10-02','0','0'); -- id=1906
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1325', '414', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=3
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1325';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 1, 1325, 0, 0
                    , 350.00, 414, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-414, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=126
UPDATE storemovement SET  buyPricesHistoryBookData = "414*2026-10-02*350.00," WHERE transferproductid = 3;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1325', '1', '414', '1', '3', 'تحويل منتجات من المخزن', 'storemovementController.php', '414', '0', '1', '2026-10-02','0','0'); -- id=1907
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1325', '2', '414', '1', '2026-10-02'); -- id=1406
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 2, 1325, 0, 0
                    , 350.00, 414, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+414, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=133
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1325', '2', '414', '0', '3', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '414', '1', '2026-10-02','0','0'); -- id=1908
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1326', '300', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=4
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1326';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 1, 1326, 0, 0
                    , 380.00, 300, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-300, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=127
UPDATE storemovement SET  buyPricesHistoryBookData = "300*2026-10-02*380.00," WHERE transferproductid = 4;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1326', '1', '300', '1', '4', 'تحويل منتجات من المخزن', 'storemovementController.php', '300', '0', '1', '2026-10-02','0','0'); -- id=1909
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1326', '2', '300', '1', '2026-10-02'); -- id=1407
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 2, 1326, 0, 0
                    , 380.00, 300, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+300, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=135
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1326', '2', '300', '0', '4', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '300', '1', '2026-10-02','0','0'); -- id=1910
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1361', '48', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=5
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1361';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 1, 1361, 0, 0
                    , 370.00, 48, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-48, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=121
UPDATE storemovement SET  buyPricesHistoryBookData = "48*2026-10-02*370.00," WHERE transferproductid = 5;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1361', '1', '48', '1', '5', 'تحويل منتجات من المخزن', 'storemovementController.php', '48', '0', '1', '2026-10-02','0','0'); -- id=1911
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1361', '2', '48', '1', '2026-10-02'); -- id=1408
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 2, 1361, 0, 0
                    , 370.00, 48, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=137
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1361', '2', '48', '0', '5', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '48', '1', '2026-10-02','0','0'); -- id=1912
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1362', '32', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=6
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1362';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 1, 1362, 0, 0
                    , 370.00, 32, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-32, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=122
UPDATE storemovement SET  buyPricesHistoryBookData = "32*2026-10-02*370.00," WHERE transferproductid = 6;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1362', '1', '32', '1', '6', 'تحويل منتجات من المخزن', 'storemovementController.php', '32', '0', '1', '2026-10-02','0','0'); -- id=1913
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1362', '2', '32', '1', '2026-10-02'); -- id=1409
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 2, 1362, 0, 0
                    , 370.00, 32, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=139
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1362', '2', '32', '0', '6', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '32', '1', '2026-10-02','0','0'); -- id=1914
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1363', '32', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=7
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1363';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 1, 1363, 0, 0
                    , 390.00, 32, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-32, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=123
UPDATE storemovement SET  buyPricesHistoryBookData = "32*2026-10-02*390.00," WHERE transferproductid = 7;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1363', '1', '32', '1', '7', 'تحويل منتجات من المخزن', 'storemovementController.php', '32', '0', '1', '2026-10-02','0','0'); -- id=1915
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1363', '2', '32', '1', '2026-10-02'); -- id=1410
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 2, 1363, 0, 0
                    , 390.00, 32, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=141
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1363', '2', '32', '0', '7', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '32', '1', '2026-10-02','0','0'); -- id=1916
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1364', '48', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=8
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1364';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 1, 1364, 0, 0
                    , 380.00, 48, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-48, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=124
UPDATE storemovement SET  buyPricesHistoryBookData = "48*2026-10-02*380.00," WHERE transferproductid = 8;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1364', '1', '48', '1', '8', 'تحويل منتجات من المخزن', 'storemovementController.php', '48', '0', '1', '2026-10-02','0','0'); -- id=1917
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1364', '2', '48', '1', '2026-10-02'); -- id=1411
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 2, 1364, 0, 0
                    , 380.00, 48, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=143
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1364', '2', '48', '0', '8', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '48', '1', '2026-10-02','0','0'); -- id=1918
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1365', '40', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=9
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1365';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 1, 1365, 0, 0
                    , 380.00, 40, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-40, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=125
UPDATE storemovement SET  buyPricesHistoryBookData = "40*2026-10-02*380.00," WHERE transferproductid = 9;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1365', '1', '40', '1', '9', 'تحويل منتجات من المخزن', 'storemovementController.php', '40', '0', '1', '2026-10-02','0','0'); -- id=1919
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1365', '2', '40', '1', '2026-10-02'); -- id=1412
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-02', 2, 1365, 0, 0
                    , 380.00, 40, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=145
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1365', '2', '40', '0', '9', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '40', '1', '2026-10-02','0','0'); -- id=1920
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1356', '200', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=10
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1356';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30', 1, 1356, 0, 0
                    , 400.00, 200, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-200, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=48
UPDATE storemovement SET  buyPricesHistoryBookData = "200*2026-09-30*400.00," WHERE transferproductid = 10;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '1', '200', '1', '10', 'تحويل منتجات من المخزن', 'storemovementController.php', '200', '0', '1', '2026-10-02','0','0'); -- id=1921
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1356', '2', '200', '1', '2026-10-02'); -- id=1413
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30', 2, 1356, 0, 0
                    , 400.00, 200, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+200, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=147
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '2', '200', '0', '10', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '200', '1', '2026-10-02','0','0'); -- id=1922
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1357', '72', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=11
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1357';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30', 1, 1357, 0, 0
                    , 410.00, 72, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-72, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=49
UPDATE storemovement SET  buyPricesHistoryBookData = "72*2026-09-30*410.00," WHERE transferproductid = 11;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1357', '1', '72', '1', '11', 'تحويل منتجات من المخزن', 'storemovementController.php', '72', '0', '1', '2026-10-02','0','0'); -- id=1923
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1357', '2', '72', '1', '2026-10-02'); -- id=1414
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30', 2, 1357, 0, 0
                    , 410.00, 72, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=149
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1357', '2', '72', '0', '11', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '72', '1', '2026-10-02','0','0'); -- id=1924
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1358', '48', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=12
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1358';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30', 1, 1358, 0, 0
                    , 380.00, 48, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-48, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=50
UPDATE storemovement SET  buyPricesHistoryBookData = "48*2026-09-30*380.00," WHERE transferproductid = 12;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1358', '1', '48', '1', '12', 'تحويل منتجات من المخزن', 'storemovementController.php', '48', '0', '1', '2026-10-02','0','0'); -- id=1925
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1358', '2', '48', '1', '2026-10-02'); -- id=1415
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30', 2, 1358, 0, 0
                    , 380.00, 48, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=151
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1358', '2', '48', '0', '12', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '48', '1', '2026-10-02','0','0'); -- id=1926
INSERT INTO storemovement (storeidfrom, storeidto, productid, transferproductamount, transferproductdate, userid, conditions ,operationnum,driverid,drivertimeout,driverdate,delivererid,deliverdate,storetype,priceType,price,sizeid,colorid,expireDate,comment,maincomment,recieveType,recieveUserid,recieveTime,deloperationnum) VALUES ('1', '2', '1359', '64', '2026-10-02', '1', '0','1','0','0','2026-10-02 17:43:44','0','','0','hide','0','0','0','','','','0','0','','0'); -- id=13
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-02' WHERE storedetailid = '1359';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30', 1, 1359, 0, 0
                    , 370.00, 64, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-64, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=51
UPDATE storemovement SET  buyPricesHistoryBookData = "64*2026-09-30*370.00," WHERE transferproductid = 13;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1359', '1', '64', '1', '13', 'تحويل منتجات من المخزن', 'storemovementController.php', '64', '0', '1', '2026-10-02','0','0'); -- id=1927
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('1359', '2', '64', '1', '2026-10-02'); -- id=1416
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-09-30', 2, 1359, 0, 0
                    , 370.00, 64, 0, 0, 1, '2026-10-02 17:43:44')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+64, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-02 17:43:44' ; -- id=153
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1359', '2', '64', '0', '13', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '64', '1', '2026-10-02','0','0'); -- id=1928
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1323;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1324;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1325;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1326;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1361;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1362;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1363;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1364;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1365;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1356;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1357;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1358;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=1359;
COMMIT;
BEGIN;
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1000710', '1000710', '2026-10-02', '1', '0', '0', '2026-10-02 17:43:44','تحويل من مخزن المخزن الرئيسي الى مخزن مخزن المحل','1','0',null,'0','1','storemovementController.php?do=show&operationnum=1'); -- id=1005
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1005', '492', '1000710', '','0'); -- id=1007
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1000710', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1005', '382', '1000710', '','0'); -- id=1005
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14179629.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
COMMIT;
COMMIT;
UPDATE storemovement SET  dailyentryid =1005 WHERE operationnum = 1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:13:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:43:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-02 17:43:45', '1', 'sucess', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=sucess'); -- id=2318
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:13:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 17:43:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-02 17:43:46', '1', 'show', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=2319
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:22:24";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:22:39";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:31:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:01:45", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 18:01:45', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2320

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abf7c7980c92
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 18:01:45', '06abf7c7980c92', '1', '0.00', '0', '0', '1', '1680.00', '1680', '1680', '0', '2', '2026-10-02 18:01:45', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1680','0','','0','0','1680','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=45
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','45', '0', '2026-10-02 18:01:45', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1680', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 18:01:45','0','0','',''); -- id=121
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 147;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','01356', '45', '88', '1356', '4', '420', '1680', '0', '', '0', '2026-10-02 18:01:45', '1356', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','147-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=232
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 232;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1356, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '196', userid = '4', storedetaildate = '2026-10-02 18:01:45' WHERE storedetailid = '1413';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '2', '4', '1', '45', 'اضافة فاتورة مبيعات', 'sellbillController.php', '200', '196', '4', '2026-10-02 18:01:45','0','0'); -- id=1929
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1680',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('0','1680', '0', '3', 'اضافة فاتورة مبيعات', '45', '1680', '2026-10-02 18:01:45', '4',  'sellbillController.php','1','','0'); -- id=63
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1680', '1680', '2026-10-02', '4', '0', '0', '2026-10-02 18:01:45','اضافة فاتورة مبيعات رقم 45','1','0',null,'0','45','sellbillController.php?do=showDetail&sellbillid=45'); -- id=1006
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1006', '501', '1680', '','0'); -- id=1008
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1680', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1006', '143', '1680', '','0'); -- id=1006
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '486535', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1600', '1600', '2026-10-02', '4', '0', '0', '2026-10-02 18:01:45','اضافة فاتورة مبيعات رقم 45 - صرف البضاعة من المخزن','1','0',null,'0','45','sellbillController.php?do=showDetail&sellbillid=45'); -- id=1007
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1007', '402', '1600', '','0'); -- id=1009
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '473474.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1007', '492', '1600', '','0'); -- id=1007
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '999110', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1006,0,1007' where sellbillid=45;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600, 1600, 1600)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1680, netSellCostBuyPrice = netSellCostBuyPrice+1600
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1600
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1600
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1600
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1600
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1600
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1600
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1600;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abf7c7980c92 and sellbillId = 45 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:31:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:01:45", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 18:01:45', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2321
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:51:20";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:21:20", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-02 18:21:20', '4', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=2322
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 14:51:38";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:21:38", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 18:21:38', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2323
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:09:57";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:39:58", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 18:39:58', '3', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2324
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 15:09:58";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 18:39:58', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2325
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:10:03";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:40:03", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 18:40:03', '3', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2326
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:15:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:45:49", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 18:45:49', '3', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2327

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd05350439
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 18:45:49', '06abfd05350439', '1', '0.00', '0', '0', '1', '12010.00', '12010', '12010', '0', '1', '2026-10-02 18:45:49', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '36' ,'0','','','','','-1','0','0','0','0','0','12010','0','','0','0','12010','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=46
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,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','46', '0', '2026-10-02 18:45:49', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '12010', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 18:45:49','0','0','',''); -- id=122
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','09261', '46', '43', '1151', '9', '350', '3150', '0', '', '0', '2026-10-02 18:45:49', '1151', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','350','3150','0','','0','0.00','0','0','0','0'); -- id=233
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 233;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1151, '2026-10-02', 3150, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3150, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3150, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3150, sellCostBuyPrice =sellCostBuyPrice+3600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '3', userid = '3', storedetaildate = '2026-10-02 18:45:49' WHERE storedetailid = '1151';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1151', '1', '9', '1', '46', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '3', '3', '2026-10-02 18:45:49','0','0'); -- id=1930
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','06594', '46', '78', '1273', '12', '420', '5040', '0', '', '0', '2026-10-02 18:45:49', '1273', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','420','5040','0','','0','0.00','0','0','0','0'); -- id=234
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 234;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1273, '2026-10-02', 5040, 4800, 4800
                    , 4800, 4800, 4800, 4800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4800, 4800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5040, sellCostBuyPrice =sellCostBuyPrice+4800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 5040, 4800, 4800
                    , 4800, 4800, 4800, 4800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4800, 4800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5040, sellCostBuyPrice =sellCostBuyPrice+4800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '47', userid = '3', storedetaildate = '2026-10-02 18:45:49' WHERE storedetailid = '1273';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1273', '1', '12', '1', '46', 'اضافة فاتورة مبيعات', 'sellbillController.php', '59', '47', '3', '2026-10-02 18:45:49','0','0'); -- id=1931
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','08144', '46', '71', '1244', '8', '250', '2000', '0', '', '0', '2026-10-02 18:45:49', '1244', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','250','2000','0','','0','0.00','0','0','0','0'); -- id=235
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 365
                where sellbilldetailid = 235;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1244, '2026-10-02', 2000, 3000, 2920
                    , 2960, 2920, 2960, 2920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2960, 2960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 2000, 3000, 2920
                    , 2960, 2920, 2960, 2920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2960, 2960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '36', userid = '3', storedetaildate = '2026-10-02 18:45:49' WHERE storedetailid = '1244';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1244', '1', '8', '1', '46', 'اضافة فاتورة مبيعات', 'sellbillController.php', '44', '36', '3', '2026-10-02 18:45:49','0','0'); -- id=1932
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('250','i0001248', '46', '71', '1248', '7', '260', '1820', '0', '', '0', '2026-10-02 18:45:49', '1248', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','260','1820','0','','0','0.00','0','0','0','0'); -- id=236
UPDATE sellbilldetail SET  lastbuyprice = 240.00 , meanbuyprice = 245.00, lastbuyprice_withDiscount = 240.00, meanbuyprice_withDiscount = 245.00
        , lastbuyprice_withTax = 245, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 240
                where sellbilldetailid = 236;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1248, '2026-10-02', 1820, 1750, 1680
                    , 1715, 1680, 1715, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7, 0, 1715, 1715, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1820, sellCostBuyPrice =sellCostBuyPrice+1750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1715
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1715
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1715
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1715
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+7
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1820, 1750, 1680
                    , 1715, 1680, 1715, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1715, 1715, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1820, sellCostBuyPrice =sellCostBuyPrice+1750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1715
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1715
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1715
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1715
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '3', storedetaildate = '2026-10-02 18:45:49' WHERE storedetailid = '1248';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1248', '1', '7', '1', '46', 'اضافة فاتورة مبيعات', 'sellbillController.php', '7', '0', '3', '2026-10-02 18:45:49','0','0'); -- id=1933
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '158715',  userid = '3' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('146705','12010', '0', '2', 'اضافة فاتورة مبيعات', '46', '158715', '2026-10-02 18:45:49', '3',  'sellbillController.php','1','','0'); -- id=64
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '12010', '12010', '2026-10-02', '3', '0', '0', '2026-10-02 18:45:49','اضافة فاتورة مبيعات رقم 46','1','0',null,'0','46','sellbillController.php?do=showDetail&sellbillid=46'); -- id=1008
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1008', '419', '12010', '','0'); -- id=1010
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '158715', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1008', '143', '12010', '','0'); -- id=1008
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '498545', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13000', '13000', '2026-10-02', '3', '0', '0', '2026-10-02 18:45:49','اضافة فاتورة مبيعات رقم 46 - صرف البضاعة من المخزن','1','0',null,'0','46','sellbillController.php?do=showDetail&sellbillid=46'); -- id=1009
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1009', '402', '13000', '','0'); -- id=1011
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '486474.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1009', '382', '13000', '','0'); -- id=1009
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14166629.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='1008,0,1009' where sellbillid=46;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 12010, 13150, 13000
                    , 13075, 13000, 13075, 13000
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,13075, 13075, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12010, sellCostBuyPrice =sellCostBuyPrice+13150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13075
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13075
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13075
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13075
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 12010, 13150, 13000
                    , 13075, 13000, 13075, 13000
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,13075, 13075, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12010, sellCostBuyPrice =sellCostBuyPrice+13150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+13000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+13075
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+13000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+13075
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+13000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+13075
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+13075
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 12010, 13150, 13000
                    , 13075, 13000, 13075, 13000, 13075, 13075)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+12010, netSellCostBuyPrice = netSellCostBuyPrice+13150
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+13000
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+13075
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+13000
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+13075
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+13000
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+13075
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+13075;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd05350439 and sellbillId = 46 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:15:49";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:45:49", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 18:45:49', '3', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2328
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:29:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:59:13", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 18:59:13', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=2329
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:29:26";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:59:26", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 18:59:26', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2330
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:29:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:59:28", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-02 18:59:28', '4', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=2331
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:29:35";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 18:59:35", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 18:59:35', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2332
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:30:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:00:46", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:00:46', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2333

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd4e768f48
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:00:46', '06abfd4e768f48', '1', '0.00', '0', '0', '1', '4590.00', '4590', '4590', '0', '2', '2026-10-02 19:00:46', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '12' ,'0','','','','','-1','0','0','0','0','0','4590','0','','0','0','4590','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=47
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','47', '0', '2026-10-02 19:00:46', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4590', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:00:46','0','0','',''); -- id=123
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 135;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','01326', '47', '87', '1326', '6', '420', '2520', '0', '', '0', '2026-10-02 19:00:46', '1326', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','135-6,','1','1','0','0','420','2520','0','','0','0.00','0','0','0','0'); -- id=237
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 237;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1326, '2026-10-02', 2520, 2280, 2280
                    , 2280, 2280, 2280, 2280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2280, 2280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2520, sellCostBuyPrice =sellCostBuyPrice+2280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 2520, 2280, 2280
                    , 2280, 2280, 2280, 2280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2280, 2280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2520, sellCostBuyPrice =sellCostBuyPrice+2280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '294', userid = '4', storedetaildate = '2026-10-02 19:00:46' WHERE storedetailid = '1407';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1326', '2', '6', '1', '47', 'اضافة فاتورة مبيعات', 'sellbillController.php', '300', '294', '4', '2026-10-02 19:00:46','0','0'); -- id=1934
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 129;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('305','01323', '47', '86', '1323', '6', '345', '2070', '0', '', '0', '2026-10-02 19:00:46', '1323', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','129-6,','1','1','0','0','345','2070','0','','0','0.00','0','0','0','0'); -- id=238
UPDATE sellbilldetail SET  lastbuyprice = 305.00 , meanbuyprice = 305.00, lastbuyprice_withDiscount = 305.00, meanbuyprice_withDiscount = 305.00
        , lastbuyprice_withTax = 305, meanbuyprice_withTax = 305, lastbuyprice_withDiscountAndTax = 305
                where sellbilldetailid = 238;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1323, '2026-10-02', 2070, 1830, 1830
                    , 1830, 1830, 1830, 1830
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1830, 1830, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2070, sellCostBuyPrice =sellCostBuyPrice+1830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1830, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1830
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1830, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1830
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1830
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1830
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1830
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+6
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 2070, 1830, 1830
                    , 1830, 1830, 1830, 1830
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1830, 1830, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2070, sellCostBuyPrice =sellCostBuyPrice+1830
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1830, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1830
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1830, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1830
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1830
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1830
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1830
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '764', userid = '4', storedetaildate = '2026-10-02 19:00:46' WHERE storedetailid = '1404';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1323', '2', '6', '1', '47', 'اضافة فاتورة مبيعات', 'sellbillController.php', '770', '764', '4', '2026-10-02 19:00:46','0','0'); -- id=1935
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6270',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('1680','4590', '0', '3', 'اضافة فاتورة مبيعات', '47', '6270', '2026-10-02 19:00:46', '4',  'sellbillController.php','1','','0'); -- id=65
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4590', '4590', '2026-10-02', '4', '0', '0', '2026-10-02 19:00:46','اضافة فاتورة مبيعات رقم 47','1','0',null,'0','47','sellbillController.php?do=showDetail&sellbillid=47'); -- id=1010
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1010', '501', '4590', '','0'); -- id=1012
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '6270', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1010', '143', '4590', '','0'); -- id=1010
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '503135', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4110', '4110', '2026-10-02', '4', '0', '0', '2026-10-02 19:00:46','اضافة فاتورة مبيعات رقم 47 - صرف البضاعة من المخزن','1','0',null,'0','47','sellbillController.php?do=showDetail&sellbillid=47'); -- id=1011
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1011', '402', '4110', '','0'); -- id=1013
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '490584.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1011', '492', '4110', '','0'); -- id=1011
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '995000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1010,0,1011' where sellbillid=47;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 4590, 4110, 4110
                    , 4110, 4110, 4110, 4110
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4110, 4110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4590, sellCostBuyPrice =sellCostBuyPrice+4110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4110
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 4590, 4110, 4110
                    , 4110, 4110, 4110, 4110
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4110, 4110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4590, sellCostBuyPrice =sellCostBuyPrice+4110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4110
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 4590, 4110, 4110
                    , 4110, 4110, 4110, 4110, 4110, 4110)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4590, netSellCostBuyPrice = netSellCostBuyPrice+4110
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4110
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4110
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4110
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4110
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4110
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4110
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4110;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd4e768f48 and sellbillId = 47 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:30:46";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:00:46", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:00:46', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2334
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:32:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:02:00", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:02:00', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2335

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd52ea2374
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:02:00', '06abfd52ea2374', '1', '0.00', '0', '0', '1', '16505.00', '16505', '16505', '0', '2', '2026-10-02 19:02:00', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '41' ,'0','','','','','-1','0','0','0','0','0','16505','0','','0','0','16505','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=48
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','48', '0', '2026-10-02 19:02:00', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '16505', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:02:00','0','0','',''); -- id=124
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 147;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','01356', '48', '88', '1356', '12', '420', '5040', '0', '', '0', '2026-10-02 19:02:00', '1356', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','147-12,','1','1','0','0','420','5040','0','','0','0.00','0','0','0','0'); -- id=239
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 239;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1356, '2026-10-02', 5040, 4800, 4800
                    , 4800, 4800, 4800, 4800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4800, 4800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5040, sellCostBuyPrice =sellCostBuyPrice+4800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 5040, 4800, 4800
                    , 4800, 4800, 4800, 4800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4800, 4800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5040, sellCostBuyPrice =sellCostBuyPrice+4800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '184', userid = '4', storedetaildate = '2026-10-02 19:02:00' WHERE storedetailid = '1413';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '2', '12', '1', '48', 'اضافة فاتورة مبيعات', 'sellbillController.php', '196', '184', '4', '2026-10-02 19:02:00','0','0'); -- id=1936
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 139;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('370','01362', '48', '89', '1362', '12', '410', '4920', '0', '', '0', '2026-10-02 19:02:00', '1362', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','139-12,','1','1','0','0','410','4920','0','','0','0.00','0','0','0','0'); -- id=240
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where sellbilldetailid = 240;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1362, '2026-10-02', 4920, 4440, 4440
                    , 4440, 4440, 4440, 4440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4440, 4440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4920, sellCostBuyPrice =sellCostBuyPrice+4440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 4920, 4440, 4440
                    , 4440, 4440, 4440, 4440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4440, 4440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4920, sellCostBuyPrice =sellCostBuyPrice+4440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '20', userid = '4', storedetaildate = '2026-10-02 19:02:00' WHERE storedetailid = '1409';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1362', '2', '12', '1', '48', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '20', '4', '2026-10-02 19:02:00','0','0'); -- id=1937
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 129;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('305','01323', '48', '86', '1323', '9', '345', '3105', '0', '', '0', '2026-10-02 19:02:00', '1323', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','129-9,','1','1','0','0','345','3105','0','','0','0.00','0','0','0','0'); -- id=241
UPDATE sellbilldetail SET  lastbuyprice = 305.00 , meanbuyprice = 305.00, lastbuyprice_withDiscount = 305.00, meanbuyprice_withDiscount = 305.00
        , lastbuyprice_withTax = 305, meanbuyprice_withTax = 305, lastbuyprice_withDiscountAndTax = 305
                where sellbilldetailid = 241;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1323, '2026-10-02', 3105, 2745, 2745
                    , 2745, 2745, 2745, 2745
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2745, 2745, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3105, sellCostBuyPrice =sellCostBuyPrice+2745
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2745, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2745
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2745, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2745
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2745
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2745
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2745
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 3105, 2745, 2745
                    , 2745, 2745, 2745, 2745
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2745, 2745, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3105, sellCostBuyPrice =sellCostBuyPrice+2745
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2745, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2745
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2745, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2745
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2745
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2745
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2745
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '755', userid = '4', storedetaildate = '2026-10-02 19:02:00' WHERE storedetailid = '1404';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1323', '2', '9', '1', '48', 'اضافة فاتورة مبيعات', 'sellbillController.php', '764', '755', '4', '2026-10-02 19:02:00','0','0'); -- id=1938
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 149;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','01357', '48', '88', '1357', '8', '430', '3440', '0', '', '0', '2026-10-02 19:02:00', '1357', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','149-8,','1','1','0','0','430','3440','0','','0','0.00','0','0','0','0'); -- id=242
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 242;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1357, '2026-10-02', 3440, 3280, 3280
                    , 3280, 3280, 3280, 3280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3280, 3280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3440, sellCostBuyPrice =sellCostBuyPrice+3280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 3440, 3280, 3280
                    , 3280, 3280, 3280, 3280
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3280, 3280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3440, sellCostBuyPrice =sellCostBuyPrice+3280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '64', userid = '4', storedetaildate = '2026-10-02 19:02:00' WHERE storedetailid = '1414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1357', '2', '8', '1', '48', 'اضافة فاتورة مبيعات', 'sellbillController.php', '72', '64', '4', '2026-10-02 19:02:00','0','0'); -- id=1939
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '22775',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6270','16505', '0', '3', 'اضافة فاتورة مبيعات', '48', '22775', '2026-10-02 19:02:00', '4',  'sellbillController.php','1','','0'); -- id=66
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '16505', '16505', '2026-10-02', '4', '0', '0', '2026-10-02 19:02:00','اضافة فاتورة مبيعات رقم 48','1','0',null,'0','48','sellbillController.php?do=showDetail&sellbillid=48'); -- id=1012
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1012', '501', '16505', '','0'); -- id=1014
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '22775', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1012', '143', '16505', '','0'); -- id=1012
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '519640', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '15265', '15265', '2026-10-02', '4', '0', '0', '2026-10-02 19:02:00','اضافة فاتورة مبيعات رقم 48 - صرف البضاعة من المخزن','1','0',null,'0','48','sellbillController.php?do=showDetail&sellbillid=48'); -- id=1013
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1013', '402', '15265', '','0'); -- id=1015
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '505849.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1013', '492', '15265', '','0'); -- id=1013
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '979735', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1012,0,1013' where sellbillid=48;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 16505, 15265, 15265
                    , 15265, 15265, 15265, 15265
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,15265, 15265, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+16505, sellCostBuyPrice =sellCostBuyPrice+15265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+15265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+15265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+15265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+15265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15265
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 16505, 15265, 15265
                    , 15265, 15265, 15265, 15265
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,15265, 15265, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+16505, sellCostBuyPrice =sellCostBuyPrice+15265
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+15265, sellCostMeanBuyPrice = sellCostMeanBuyPrice+15265
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+15265, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+15265
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+15265
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+15265
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+15265
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 16505, 15265, 15265
                    , 15265, 15265, 15265, 15265, 15265, 15265)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+16505, netSellCostBuyPrice = netSellCostBuyPrice+15265
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+15265
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+15265
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+15265
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+15265
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+15265
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+15265
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+15265;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd52ea2374 and sellbillId = 48 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:32:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:02:00", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:02:00', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2336
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:32:04";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:02:04", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-02 19:02:04', '4', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=2337
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:32:28";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:02:28", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:02:28', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2338
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:33:41";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:03:41", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:03:41', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2339

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd594b069a
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:03:41', '06abfd594b069a', '1', '0.00', '0', '0', '1', '19200.00', '19200', '19200', '0', '2', '2026-10-02 19:03:41', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '48' ,'0','','','','','-1','0','0','0','0','0','19200','0','','0','0','19200','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=49
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','49', '0', '2026-10-02 19:03:41', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '19200', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:03:41','0','0','',''); -- id=125
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 where id = 147;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','01356', '49', '88', '1356', '16', '420', '6720', '0', '', '0', '2026-10-02 19:03:41', '1356', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','147-16,','1','1','0','0','420','6720','0','','0','0.00','0','0','0','0'); -- id=243
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 243;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1356, '2026-10-02', 6720, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6720, sellCostBuyPrice =sellCostBuyPrice+6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+16
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 6720, 6400, 6400
                    , 6400, 6400, 6400, 6400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6400, 6400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6720, sellCostBuyPrice =sellCostBuyPrice+6400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '168', userid = '4', storedetaildate = '2026-10-02 19:03:41' WHERE storedetailid = '1413';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '2', '16', '1', '49', 'اضافة فاتورة مبيعات', 'sellbillController.php', '184', '168', '4', '2026-10-02 19:03:41','0','0'); -- id=1940
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 131;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','01324', '49', '86', '1324', '8', '390', '3120', '0', '', '0', '2026-10-02 19:03:41', '1324', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','131-8,','1','1','0','0','390','3120','0','','0','0.00','0','0','0','0'); -- id=244
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 244;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1324, '2026-10-02', 3120, 2800, 2800
                    , 2800, 2800, 2800, 2800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2800, 2800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3120, sellCostBuyPrice =sellCostBuyPrice+2800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 3120, 2800, 2800
                    , 2800, 2800, 2800, 2800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2800, 2800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3120, sellCostBuyPrice =sellCostBuyPrice+2800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '792', userid = '4', storedetaildate = '2026-10-02 19:03:41' WHERE storedetailid = '1405';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1324', '2', '8', '1', '49', 'اضافة فاتورة مبيعات', 'sellbillController.php', '800', '792', '4', '2026-10-02 19:03:41','0','0'); -- id=1941
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 133;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','01325', '49', '87', '1325', '12', '390', '4680', '0', '', '0', '2026-10-02 19:03:41', '1325', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','133-12,','1','1','0','0','390','4680','0','','0','0.00','0','0','0','0'); -- id=245
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 245;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1325, '2026-10-02', 4680, 4200, 4200
                    , 4200, 4200, 4200, 4200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4680, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 4680, 4200, 4200
                    , 4200, 4200, 4200, 4200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4680, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '402', userid = '4', storedetaildate = '2026-10-02 19:03:41' WHERE storedetailid = '1406';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1325', '2', '12', '1', '49', 'اضافة فاتورة مبيعات', 'sellbillController.php', '414', '402', '4', '2026-10-02 19:03:41','0','0'); -- id=1942
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 153;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('370','01359', '49', '88', '1359', '12', '390', '4680', '0', '', '0', '2026-10-02 19:03:41', '1359', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','153-12,','1','1','0','0','390','4680','0','','0','0.00','0','0','0','0'); -- id=246
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where sellbilldetailid = 246;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1359, '2026-10-02', 4680, 4440, 4440
                    , 4440, 4440, 4440, 4440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4440, 4440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4680, sellCostBuyPrice =sellCostBuyPrice+4440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 4680, 4440, 4440
                    , 4440, 4440, 4440, 4440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4440, 4440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4680, sellCostBuyPrice =sellCostBuyPrice+4440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '52', userid = '4', storedetaildate = '2026-10-02 19:03:41' WHERE storedetailid = '1416';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1359', '2', '12', '1', '49', 'اضافة فاتورة مبيعات', 'sellbillController.php', '64', '52', '4', '2026-10-02 19:03:41','0','0'); -- id=1943
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '41975',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('22775','19200', '0', '3', 'اضافة فاتورة مبيعات', '49', '41975', '2026-10-02 19:03:41', '4',  'sellbillController.php','1','','0'); -- id=67
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '19200', '19200', '2026-10-02', '4', '0', '0', '2026-10-02 19:03:41','اضافة فاتورة مبيعات رقم 49','1','0',null,'0','49','sellbillController.php?do=showDetail&sellbillid=49'); -- id=1014
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1014', '501', '19200', '','0'); -- id=1016
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '41975', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1014', '143', '19200', '','0'); -- id=1014
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '538840', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '17840', '17840', '2026-10-02', '4', '0', '0', '2026-10-02 19:03:41','اضافة فاتورة مبيعات رقم 49 - صرف البضاعة من المخزن','1','0',null,'0','49','sellbillController.php?do=showDetail&sellbillid=49'); -- id=1015
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1015', '402', '17840', '','0'); -- id=1017
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '523689.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1015', '492', '17840', '','0'); -- id=1015
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '961895', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1014,0,1015' where sellbillid=49;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 19200, 17840, 17840
                    , 17840, 17840, 17840, 17840
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,17840, 17840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19200, sellCostBuyPrice =sellCostBuyPrice+17840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 19200, 17840, 17840
                    , 17840, 17840, 17840, 17840
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,17840, 17840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+19200, sellCostBuyPrice =sellCostBuyPrice+17840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+17840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+17840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+17840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 19200, 17840, 17840
                    , 17840, 17840, 17840, 17840, 17840, 17840)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+19200, netSellCostBuyPrice = netSellCostBuyPrice+17840
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+17840
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+17840
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+17840
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+17840
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+17840
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+17840
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+17840;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd594b069a and sellbillId = 49 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:33:41";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:03:41", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:03:41', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2340
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:33:45";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:03:45", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-02 19:03:45', '4', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=2341
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:33:54";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:03:54", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:03:54', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2342
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:34:26";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:04:26", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:04:26', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2343

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd5ea874e2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:04:26', '06abfd5ea874e2', '1', '0.00', '0', '0', '1', '1170.00', '1170', '1170', '0', '2', '2026-10-02 19:04:26', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1170','0','','0','0','1170','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=50
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','50', '0', '2026-10-02 19:04:26', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1170', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:04:26','0','0','',''); -- id=126
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 133;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','01325', '50', '87', '1325', '3', '390', '1170', '0', '', '0', '2026-10-02 19:04:26', '1325', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','133-3,','1','1','0','0','390','1170','0','','0','0.00','0','0','0','0'); -- id=247
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 247;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1325, '2026-10-02', 1170, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1170, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 1170, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1170, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '399', userid = '4', storedetaildate = '2026-10-02 19:04:26' WHERE storedetailid = '1406';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1325', '2', '3', '1', '50', 'اضافة فاتورة مبيعات', 'sellbillController.php', '402', '399', '4', '2026-10-02 19:04:26','0','0'); -- id=1944
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '43145',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('41975','1170', '0', '3', 'اضافة فاتورة مبيعات', '50', '43145', '2026-10-02 19:04:26', '4',  'sellbillController.php','1','','0'); -- id=68
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1170', '1170', '2026-10-02', '4', '0', '0', '2026-10-02 19:04:26','اضافة فاتورة مبيعات رقم 50','1','0',null,'0','50','sellbillController.php?do=showDetail&sellbillid=50'); -- id=1016
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1016', '501', '1170', '','0'); -- id=1018
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '43145', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1016', '143', '1170', '','0'); -- id=1016
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '540010', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1050', '1050', '2026-10-02', '4', '0', '0', '2026-10-02 19:04:26','اضافة فاتورة مبيعات رقم 50 - صرف البضاعة من المخزن','1','0',null,'0','50','sellbillController.php?do=showDetail&sellbillid=50'); -- id=1017
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1017', '402', '1050', '','0'); -- id=1019
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '524739.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1017', '492', '1050', '','0'); -- id=1017
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '960845', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1016,0,1017' where sellbillid=50;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 1170, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1170, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1170, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1170, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1050
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1170, 1050, 1050
                    , 1050, 1050, 1050, 1050, 1050, 1050)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1170, netSellCostBuyPrice = netSellCostBuyPrice+1050
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1050
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1050
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1050
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1050
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1050
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1050
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1050;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd5ea874e2 and sellbillId = 50 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:34:26";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:04:26", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:04:26', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2344
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:34:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:04:59", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:04:59', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2345

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd60ae69e4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:04:59', '06abfd60ae69e4', '1', '0.00', '0', '0', '1', '1035.00', '1035', '1035', '0', '2', '2026-10-02 19:04:59', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1035','0','','0','0','1035','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=51
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','51', '0', '2026-10-02 19:04:59', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1035', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:04:59','0','0','',''); -- id=127
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 129;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('305','01323', '51', '86', '1323', '3', '345', '1035', '0', '', '0', '2026-10-02 19:04:59', '1323', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','129-3,','1','1','0','0','345','1035','0','','0','0.00','0','0','0','0'); -- id=248
UPDATE sellbilldetail SET  lastbuyprice = 305.00 , meanbuyprice = 305.00, lastbuyprice_withDiscount = 305.00, meanbuyprice_withDiscount = 305.00
        , lastbuyprice_withTax = 305, meanbuyprice_withTax = 305, lastbuyprice_withDiscountAndTax = 305
                where sellbilldetailid = 248;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1323, '2026-10-02', 1035, 915, 915
                    , 915, 915, 915, 915
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 915, 915, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1035, sellCostBuyPrice =sellCostBuyPrice+915
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+915, sellCostMeanBuyPrice = sellCostMeanBuyPrice+915
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+915, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+915
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+915
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+915
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+915
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 1035, 915, 915
                    , 915, 915, 915, 915
                    , 0, 0, 0, 0
                    , 0, 0, 0, 915, 915, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1035, sellCostBuyPrice =sellCostBuyPrice+915
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+915, sellCostMeanBuyPrice = sellCostMeanBuyPrice+915
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+915, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+915
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+915
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+915
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+915
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '752', userid = '4', storedetaildate = '2026-10-02 19:04:59' WHERE storedetailid = '1404';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1323', '2', '3', '1', '51', 'اضافة فاتورة مبيعات', 'sellbillController.php', '755', '752', '4', '2026-10-02 19:04:59','0','0'); -- id=1945
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '44180',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('43145','1035', '0', '3', 'اضافة فاتورة مبيعات', '51', '44180', '2026-10-02 19:04:59', '4',  'sellbillController.php','1','','0'); -- id=69
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1035', '1035', '2026-10-02', '4', '0', '0', '2026-10-02 19:04:59','اضافة فاتورة مبيعات رقم 51','1','0',null,'0','51','sellbillController.php?do=showDetail&sellbillid=51'); -- id=1018
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1018', '501', '1035', '','0'); -- id=1020
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '44180', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1018', '143', '1035', '','0'); -- id=1018
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '541045', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '915', '915', '2026-10-02', '4', '0', '0', '2026-10-02 19:04:59','اضافة فاتورة مبيعات رقم 51 - صرف البضاعة من المخزن','1','0',null,'0','51','sellbillController.php?do=showDetail&sellbillid=51'); -- id=1019
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1019', '402', '915', '','0'); -- id=1021
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '525654.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1019', '492', '915', '','0'); -- id=1019
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '959930', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1018,0,1019' where sellbillid=51;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 1035, 915, 915
                    , 915, 915, 915, 915
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,915, 915, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1035, sellCostBuyPrice =sellCostBuyPrice+915
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+915, sellCostMeanBuyPrice = sellCostMeanBuyPrice+915
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+915, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+915
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+915
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+915
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+915
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1035, 915, 915
                    , 915, 915, 915, 915
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,915, 915, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1035, sellCostBuyPrice =sellCostBuyPrice+915
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+915, sellCostMeanBuyPrice = sellCostMeanBuyPrice+915
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+915, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+915
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+915
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+915
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+915
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1035, 915, 915
                    , 915, 915, 915, 915, 915, 915)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1035, netSellCostBuyPrice = netSellCostBuyPrice+915
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+915
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+915
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+915
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+915
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+915
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+915
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+915;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd60ae69e4 and sellbillId = 51 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:34:59";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:04:59", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:04:59', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2346
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:36:23";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:06:23", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:06:23', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2347

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd62b5035c
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:06:23', '06abfd62b5035c', '1', '0.00', '0', '0', '1', '26570.00', '26570', '26570', '0', '2', '2026-10-02 19:06:23', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '64' ,'0','','','','','-1','0','0','0','0','0','26570','0','','0','0','26570','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=52
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','52', '0', '2026-10-02 19:06:23', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '26570', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:06:23','0','0','',''); -- id=128
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 135;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','01326', '52', '87', '1326', '15', '420', '6300', '0', '', '0', '2026-10-02 19:06:23', '1326', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','135-15,','1','1','0','0','420','6300','0','','0','0.00','0','0','0','0'); -- id=249
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 249;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1326, '2026-10-02', 6300, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6300, sellCostBuyPrice =sellCostBuyPrice+5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+15
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 6300, 5700, 5700
                    , 5700, 5700, 5700, 5700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5700, 5700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6300, sellCostBuyPrice =sellCostBuyPrice+5700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '279', userid = '4', storedetaildate = '2026-10-02 19:06:23' WHERE storedetailid = '1407';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1326', '2', '15', '1', '52', 'اضافة فاتورة مبيعات', 'sellbillController.php', '294', '279', '4', '2026-10-02 19:06:23','0','0'); -- id=1946
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 147;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','01356', '52', '88', '1356', '20', '420', '8400', '0', '', '0', '2026-10-02 19:06:23', '1356', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','147-20,','1','1','0','0','420','8400','0','','0','0.00','0','0','0','0'); -- id=250
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 250;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1356, '2026-10-02', 8400, 8000, 8000
                    , 8000, 8000, 8000, 8000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8000, 8000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8400, sellCostBuyPrice =sellCostBuyPrice+8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 8400, 8000, 8000
                    , 8000, 8000, 8000, 8000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8000, 8000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8400, sellCostBuyPrice =sellCostBuyPrice+8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '148', userid = '4', storedetaildate = '2026-10-02 19:06:23' WHERE storedetailid = '1413';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '2', '20', '1', '52', 'اضافة فاتورة مبيعات', 'sellbillController.php', '168', '148', '4', '2026-10-02 19:06:23','0','0'); -- id=1947
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 151;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','01358', '52', '88', '1358', '8', '400', '3200', '0', '', '0', '2026-10-02 19:06:23', '1358', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','151-8,','1','1','0','0','400','3200','0','','0','0.00','0','0','0','0'); -- id=251
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 251;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1358, '2026-10-02', 3200, 3040, 3040
                    , 3040, 3040, 3040, 3040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3040, 3040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 3200, 3040, 3040
                    , 3040, 3040, 3040, 3040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3040, 3040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '40', userid = '4', storedetaildate = '2026-10-02 19:06:24' WHERE storedetailid = '1415';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1358', '2', '8', '1', '52', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '40', '4', '2026-10-02 19:06:24','0','0'); -- id=1948
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 149;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','01357', '52', '88', '1357', '12', '430', '5160', '0', '', '0', '2026-10-02 19:06:24', '1357', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','149-12,','1','1','0','0','430','5160','0','','0','0.00','0','0','0','0'); -- id=252
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 252;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1357, '2026-10-02', 5160, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5160, sellCostBuyPrice =sellCostBuyPrice+4920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+12
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 5160, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5160, sellCostBuyPrice =sellCostBuyPrice+4920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '52', userid = '4', storedetaildate = '2026-10-02 19:06:24' WHERE storedetailid = '1414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1357', '2', '12', '1', '52', 'اضافة فاتورة مبيعات', 'sellbillController.php', '64', '52', '4', '2026-10-02 19:06:24','0','0'); -- id=1949
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 133;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','01325', '52', '87', '1325', '9', '390', '3510', '0', '', '0', '2026-10-02 19:06:24', '1325', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','133-9,','1','1','0','0','390','3510','0','','0','0.00','0','0','0','0'); -- id=253
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 253;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1325, '2026-10-02', 3510, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3510, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 3510, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3510, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '390', userid = '4', storedetaildate = '2026-10-02 19:06:24' WHERE storedetailid = '1406';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1325', '2', '9', '1', '52', 'اضافة فاتورة مبيعات', 'sellbillController.php', '399', '390', '4', '2026-10-02 19:06:24','0','0'); -- id=1950
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '70750',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('44180','26570', '0', '3', 'اضافة فاتورة مبيعات', '52', '70750', '2026-10-02 19:06:24', '4',  'sellbillController.php','1','','0'); -- id=70
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '26570', '26570', '2026-10-02', '4', '0', '0', '2026-10-02 19:06:24','اضافة فاتورة مبيعات رقم 52','1','0',null,'0','52','sellbillController.php?do=showDetail&sellbillid=52'); -- id=1020
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1020', '501', '26570', '','0'); -- id=1022
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '70750', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1020', '143', '26570', '','0'); -- id=1020
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '567615', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '24810', '24810', '2026-10-02', '4', '0', '0', '2026-10-02 19:06:24','اضافة فاتورة مبيعات رقم 52 - صرف البضاعة من المخزن','1','0',null,'0','52','sellbillController.php?do=showDetail&sellbillid=52'); -- id=1021
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1021', '402', '24810', '','0'); -- id=1023
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '550464.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1021', '492', '24810', '','0'); -- id=1021
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '935120', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1020,0,1021' where sellbillid=52;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 26570, 24810, 24810
                    , 24810, 24810, 24810, 24810
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,24810, 24810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+26570, sellCostBuyPrice =sellCostBuyPrice+24810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+24810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+24810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+24810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+24810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+24810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+24810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+24810
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 26570, 24810, 24810
                    , 24810, 24810, 24810, 24810
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,24810, 24810, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+26570, sellCostBuyPrice =sellCostBuyPrice+24810
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+24810, sellCostMeanBuyPrice = sellCostMeanBuyPrice+24810
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+24810, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+24810
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+24810
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+24810
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+24810
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 26570, 24810, 24810
                    , 24810, 24810, 24810, 24810, 24810, 24810)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+26570, netSellCostBuyPrice = netSellCostBuyPrice+24810
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+24810
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+24810
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+24810
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+24810
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+24810
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+24810
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+24810;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd62b5035c and sellbillId = 52 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:36:24";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:06:24", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:06:24', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2348
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:37:02";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:07:02", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-02 19:07:02', '4', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=2349
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:37:11";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:07:11", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:07:11', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2350
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:37:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:07:42", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:07:42', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2351

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd6afc2ff1
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:07:42', '06abfd6afc2ff1', '1', '0.00', '0', '0', '1', '1680.00', '1680', '1680', '0', '2', '2026-10-02 19:07:42', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1680','0','','0','0','1680','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=53
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','53', '0', '2026-10-02 19:07:42', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1680', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:07:42','0','0','',''); -- id=129
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 147;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','01356', '53', '88', '1356', '4', '420', '1680', '0', '', '0', '2026-10-02 19:07:42', '1356', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','147-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=254
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 254;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1356, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '144', userid = '4', storedetaildate = '2026-10-02 19:07:42' WHERE storedetailid = '1413';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '2', '4', '1', '53', 'اضافة فاتورة مبيعات', 'sellbillController.php', '148', '144', '4', '2026-10-02 19:07:42','0','0'); -- id=1951
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '72430',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('70750','1680', '0', '3', 'اضافة فاتورة مبيعات', '53', '72430', '2026-10-02 19:07:42', '4',  'sellbillController.php','1','','0'); -- id=71
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1680', '1680', '2026-10-02', '4', '0', '0', '2026-10-02 19:07:42','اضافة فاتورة مبيعات رقم 53','1','0',null,'0','53','sellbillController.php?do=showDetail&sellbillid=53'); -- id=1022
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1022', '501', '1680', '','0'); -- id=1024
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '72430', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1022', '143', '1680', '','0'); -- id=1022
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '569295', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1600', '1600', '2026-10-02', '4', '0', '0', '2026-10-02 19:07:42','اضافة فاتورة مبيعات رقم 53 - صرف البضاعة من المخزن','1','0',null,'0','53','sellbillController.php?do=showDetail&sellbillid=53'); -- id=1023
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1023', '402', '1600', '','0'); -- id=1025
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '552064.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1023', '492', '1600', '','0'); -- id=1023
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '933520', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1022,0,1023' where sellbillid=53;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600, 1600, 1600)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1680, netSellCostBuyPrice = netSellCostBuyPrice+1600
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1600
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1600
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1600
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1600
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1600
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1600
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1600;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd6afc2ff1 and sellbillId = 53 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:37:42";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:07:42", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:07:42', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2352
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:38:36";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:08:36", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:08:36', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2353

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd6cf064a2
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:08:36', '06abfd6cf064a2', '1', '0.00', '0', '0', '1', '8900.00', '8900', '8900', '0', '2', '2026-10-02 19:08:36', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '21' ,'0','','','','','-1','0','0','0','0','0','8900','0','','0','0','8900','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=54
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','54', '0', '2026-10-02 19:08:36', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8900', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:08:36','0','0','',''); -- id=130
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 147;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','01356', '54', '88', '1356', '4', '420', '1680', '0', '', '0', '2026-10-02 19:08:36', '1356', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','147-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=255
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 255;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1356, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '140', userid = '4', storedetaildate = '2026-10-02 19:08:36' WHERE storedetailid = '1413';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '2', '4', '1', '54', 'اضافة فاتورة مبيعات', 'sellbillController.php', '144', '140', '4', '2026-10-02 19:08:36','0','0'); -- id=1952
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 135;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('380','01326', '54', '87', '1326', '9', '420', '3780', '0', '', '0', '2026-10-02 19:08:36', '1326', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','135-9,','1','1','0','0','420','3780','0','','0','0.00','0','0','0','0'); -- id=256
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 380.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where sellbilldetailid = 256;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1326, '2026-10-02', 3780, 3420, 3420
                    , 3420, 3420, 3420, 3420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3420, 3420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 3780, 3420, 3420
                    , 3420, 3420, 3420, 3420
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3420, 3420, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3780, sellCostBuyPrice =sellCostBuyPrice+3420
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3420, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3420
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3420, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3420
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3420
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3420
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3420
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '270', userid = '4', storedetaildate = '2026-10-02 19:08:36' WHERE storedetailid = '1407';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1326', '2', '9', '1', '54', 'اضافة فاتورة مبيعات', 'sellbillController.php', '279', '270', '4', '2026-10-02 19:08:36','0','0'); -- id=1953
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 141;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('390','01363', '54', '89', '1363', '8', '430', '3440', '0', '', '0', '2026-10-02 19:08:36', '1363', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','141-8,','1','1','0','0','430','3440','0','','0','0.00','0','0','0','0'); -- id=257
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 390.00, meanbuyprice_withDiscount = 390.00
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 390
                where sellbilldetailid = 257;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1363, '2026-10-02', 3440, 3120, 3120
                    , 3120, 3120, 3120, 3120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3120, 3120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3440, sellCostBuyPrice =sellCostBuyPrice+3120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 3440, 3120, 3120
                    , 3120, 3120, 3120, 3120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3120, 3120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3440, sellCostBuyPrice =sellCostBuyPrice+3120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '24', userid = '4', storedetaildate = '2026-10-02 19:08:36' WHERE storedetailid = '1410';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1363', '2', '8', '1', '54', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '24', '4', '2026-10-02 19:08:36','0','0'); -- id=1954
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '81330',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('72430','8900', '0', '3', 'اضافة فاتورة مبيعات', '54', '81330', '2026-10-02 19:08:36', '4',  'sellbillController.php','1','','0'); -- id=72
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8900', '8900', '2026-10-02', '4', '0', '0', '2026-10-02 19:08:36','اضافة فاتورة مبيعات رقم 54','1','0',null,'0','54','sellbillController.php?do=showDetail&sellbillid=54'); -- id=1024
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1024', '501', '8900', '','0'); -- id=1026
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '81330', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1024', '143', '8900', '','0'); -- id=1024
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '578195', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8140', '8140', '2026-10-02', '4', '0', '0', '2026-10-02 19:08:36','اضافة فاتورة مبيعات رقم 54 - صرف البضاعة من المخزن','1','0',null,'0','54','sellbillController.php?do=showDetail&sellbillid=54'); -- id=1025
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1025', '402', '8140', '','0'); -- id=1027
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '560204.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1025', '492', '8140', '','0'); -- id=1025
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '925380', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1024,0,1025' where sellbillid=54;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 8900, 8140, 8140
                    , 8140, 8140, 8140, 8140
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8140, 8140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8900, sellCostBuyPrice =sellCostBuyPrice+8140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 8900, 8140, 8140
                    , 8140, 8140, 8140, 8140
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8140, 8140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8900, sellCostBuyPrice =sellCostBuyPrice+8140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 8900, 8140, 8140
                    , 8140, 8140, 8140, 8140, 8140, 8140)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8900, netSellCostBuyPrice = netSellCostBuyPrice+8140
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8140
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+8140
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8140
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+8140
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8140
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+8140
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+8140;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd6cf064a2 and sellbillId = 54 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:38:37";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:08:37", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:08:37', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2354
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:39:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:09:55", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:09:55', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2355

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd7052d6e4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:09:55', '06abfd7052d6e4', '1', '0.00', '0', '0', '1', '12110.00', '12110', '12110', '0', '2', '2026-10-02 19:09:55', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '29' ,'0','','','','','-1','0','0','0','0','0','12110','0','','0','0','12110','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=55
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','55', '0', '2026-10-02 19:09:55', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '12110', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:09:55','0','0','',''); -- id=131
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 133;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('350','01325', '55', '87', '1325', '9', '390', '3510', '0', '', '0', '2026-10-02 19:09:55', '1325', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','133-9,','1','1','0','0','390','3510','0','','0','0.00','0','0','0','0'); -- id=258
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 258;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1325, '2026-10-02', 3510, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3510, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+9
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 3510, 3150, 3150
                    , 3150, 3150, 3150, 3150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3510, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '381', userid = '4', storedetaildate = '2026-10-02 19:09:55' WHERE storedetailid = '1406';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1325', '2', '9', '1', '55', 'اضافة فاتورة مبيعات', 'sellbillController.php', '390', '381', '4', '2026-10-02 19:09:55','0','0'); -- id=1955
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 149;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','01357', '55', '88', '1357', '20', '430', '8600', '0', '', '0', '2026-10-02 19:09:55', '1357', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','149-20,','1','1','0','0','430','8600','0','','0','0.00','0','0','0','0'); -- id=259
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 259;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1357, '2026-10-02', 8600, 8200, 8200
                    , 8200, 8200, 8200, 8200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8200, 8200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8600, sellCostBuyPrice =sellCostBuyPrice+8200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 8600, 8200, 8200
                    , 8200, 8200, 8200, 8200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8200, 8200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8600, sellCostBuyPrice =sellCostBuyPrice+8200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '32', userid = '4', storedetaildate = '2026-10-02 19:09:55' WHERE storedetailid = '1414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1357', '2', '20', '1', '55', 'اضافة فاتورة مبيعات', 'sellbillController.php', '52', '32', '4', '2026-10-02 19:09:55','0','0'); -- id=1956
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '93440',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('81330','12110', '0', '3', 'اضافة فاتورة مبيعات', '55', '93440', '2026-10-02 19:09:55', '4',  'sellbillController.php','1','','0'); -- id=73
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '12110', '12110', '2026-10-02', '4', '0', '0', '2026-10-02 19:09:55','اضافة فاتورة مبيعات رقم 55','1','0',null,'0','55','sellbillController.php?do=showDetail&sellbillid=55'); -- id=1026
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1026', '501', '12110', '','0'); -- id=1028
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '93440', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1026', '143', '12110', '','0'); -- id=1026
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '590305', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11350', '11350', '2026-10-02', '4', '0', '0', '2026-10-02 19:09:55','اضافة فاتورة مبيعات رقم 55 - صرف البضاعة من المخزن','1','0',null,'0','55','sellbillController.php?do=showDetail&sellbillid=55'); -- id=1027
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1027', '402', '11350', '','0'); -- id=1029
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '571554.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1027', '492', '11350', '','0'); -- id=1027
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '914030', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1026,0,1027' where sellbillid=55;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 12110, 11350, 11350
                    , 11350, 11350, 11350, 11350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11350, 11350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12110, sellCostBuyPrice =sellCostBuyPrice+11350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 12110, 11350, 11350
                    , 11350, 11350, 11350, 11350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11350, 11350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12110, sellCostBuyPrice =sellCostBuyPrice+11350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 12110, 11350, 11350
                    , 11350, 11350, 11350, 11350, 11350, 11350)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+12110, netSellCostBuyPrice = netSellCostBuyPrice+11350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+11350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+11350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+11350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+11350
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+11350
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+11350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+11350;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd7052d6e4 and sellbillId = 55 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:39:55";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:09:55", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:09:55', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2356
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:40:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:10:18", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:10:18', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2357

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd753e8e17
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:10:18', '06abfd753e8e17', '1', '0.00', '0', '0', '1', '1680.00', '1680', '1680', '0', '2', '2026-10-02 19:10:18', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','1680','0','','0','0','1680','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=56
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','56', '0', '2026-10-02 19:10:18', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1680', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:10:18','0','0','',''); -- id=132
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 147;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','01356', '56', '88', '1356', '4', '420', '1680', '0', '', '0', '2026-10-02 19:10:18', '1356', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','147-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=260
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 260;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1356, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '136', userid = '4', storedetaildate = '2026-10-02 19:10:18' WHERE storedetailid = '1413';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '2', '4', '1', '56', 'اضافة فاتورة مبيعات', 'sellbillController.php', '140', '136', '4', '2026-10-02 19:10:18','0','0'); -- id=1957
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '95120',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('93440','1680', '0', '3', 'اضافة فاتورة مبيعات', '56', '95120', '2026-10-02 19:10:18', '4',  'sellbillController.php','1','','0'); -- id=74
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1680', '1680', '2026-10-02', '4', '0', '0', '2026-10-02 19:10:18','اضافة فاتورة مبيعات رقم 56','1','0',null,'0','56','sellbillController.php?do=showDetail&sellbillid=56'); -- id=1028
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1028', '501', '1680', '','0'); -- id=1030
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '95120', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1028', '143', '1680', '','0'); -- id=1028
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '591985', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1600', '1600', '2026-10-02', '4', '0', '0', '2026-10-02 19:10:18','اضافة فاتورة مبيعات رقم 56 - صرف البضاعة من المخزن','1','0',null,'0','56','sellbillController.php?do=showDetail&sellbillid=56'); -- id=1029
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1029', '402', '1600', '','0'); -- id=1031
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '573154.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1029', '492', '1600', '','0'); -- id=1029
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '912430', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1028,0,1029' where sellbillid=56;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600, 1600, 1600)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1680, netSellCostBuyPrice = netSellCostBuyPrice+1600
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1600
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1600
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1600
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1600
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1600
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1600
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1600;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd753e8e17 and sellbillId = 56 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:40:18";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:10:18", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:10:18', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2358
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:41:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:11:13", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:11:13', '4', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2359

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd76ab483f
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:11:13', '06abfd76ab483f', '1', '0.00', '0', '0', '1', '6680.00', '6680', '6680', '0', '2', '2026-10-02 19:11:13', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '16' ,'0','','','','','-1','0','0','0','0','0','6680','0','','0','0','6680','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=57
UPDATE client SET  clientdebt = '0', userid = '4' WHERE clientid = '1';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, clientdebtchangeamount, clientdebtchangetype, processname, clientdebtchangemodelid, clientdebtchangeafter, clientdebtchangedate, userid, tablename, comment, totalOperationCost,discount,reciptid,dailyentryid , num , billid , paytype, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','57', '0', '2026-10-02 19:11:13', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6680', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:11:13','0','0','',''); -- id=133
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 149;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('410','01357', '57', '88', '1357', '4', '430', '1720', '0', '', '0', '2026-10-02 19:11:13', '1357', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','149-4,','1','1','0','0','430','1720','0','','0','0.00','0','0','0','0'); -- id=261
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 261;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1357, '2026-10-02', 1720, 1640, 1640
                    , 1640, 1640, 1640, 1640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1640, 1640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1720, sellCostBuyPrice =sellCostBuyPrice+1640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 1720, 1640, 1640
                    , 1640, 1640, 1640, 1640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1640, 1640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1720, sellCostBuyPrice =sellCostBuyPrice+1640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '28', userid = '4', storedetaildate = '2026-10-02 19:11:13' WHERE storedetailid = '1414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1357', '2', '4', '1', '57', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '28', '4', '2026-10-02 19:11:13','0','0'); -- id=1958
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 137;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('370','01361', '57', '89', '1361', '8', '410', '3280', '0', '', '0', '2026-10-02 19:11:13', '1361', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','137-8,','1','1','0','0','410','3280','0','','0','0.00','0','0','0','0'); -- id=262
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 370.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where sellbilldetailid = 262;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1361, '2026-10-02', 3280, 2960, 2960
                    , 2960, 2960, 2960, 2960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 2960, 2960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3280, sellCostBuyPrice =sellCostBuyPrice+2960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+8
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 3280, 2960, 2960
                    , 2960, 2960, 2960, 2960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2960, 2960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3280, sellCostBuyPrice =sellCostBuyPrice+2960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '40', userid = '4', storedetaildate = '2026-10-02 19:11:13' WHERE storedetailid = '1408';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1361', '2', '8', '1', '57', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '40', '4', '2026-10-02 19:11:13','0','0'); -- id=1959
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 147;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('400','01356', '57', '88', '1356', '4', '420', '1680', '0', '', '0', '2026-10-02 19:11:13', '1356', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','147-4,','1','1','0','0','420','1680','0','','0','0.00','0','0','0','0'); -- id=263
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 400.00, meanbuyprice_withDiscount = 400.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where sellbilldetailid = 263;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1356, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2, '2026-10-02', 1680, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1680, sellCostBuyPrice =sellCostBuyPrice+1600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '132', userid = '4', storedetaildate = '2026-10-02 19:11:13' WHERE storedetailid = '1413';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1356', '2', '4', '1', '57', 'اضافة فاتورة مبيعات', 'sellbillController.php', '136', '132', '4', '2026-10-02 19:11:13','0','0'); -- id=1960
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '101800',  userid = '4' WHERE saveid = '3';
UPDATE save SET  inUse = 0 where saveid = 3;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('95120','6680', '0', '3', 'اضافة فاتورة مبيعات', '57', '101800', '2026-10-02 19:11:13', '4',  'sellbillController.php','1','','0'); -- id=75
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6680', '6680', '2026-10-02', '4', '0', '0', '2026-10-02 19:11:13','اضافة فاتورة مبيعات رقم 57','1','0',null,'0','57','sellbillController.php?do=showDetail&sellbillid=57'); -- id=1030
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1030', '501', '6680', '','0'); -- id=1032
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '101800', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 21:35:47' WHERE id = '501';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1030', '143', '6680', '','0'); -- id=1030
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '598665', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6200', '6200', '2026-10-02', '4', '0', '0', '2026-10-02 19:11:13','اضافة فاتورة مبيعات رقم 57 - صرف البضاعة من المخزن','1','0',null,'0','57','sellbillController.php?do=showDetail&sellbillid=57'); -- id=1031
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1031', '402', '6200', '','0'); -- id=1033
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '579354.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1031', '492', '6200', '','0'); -- id=1031
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '906230', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-29 19:38:59' WHERE id = '492';
update sellbill set dailyentryid='1030,0,1031' where sellbillid=57;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 6680, 6200, 6200
                    , 6200, 6200, 6200, 6200
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6200, 6200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6680, sellCostBuyPrice =sellCostBuyPrice+6200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 6680, 6200, 6200
                    , 6200, 6200, 6200, 6200
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6200, 6200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6680, sellCostBuyPrice =sellCostBuyPrice+6200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6200
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 6680, 6200, 6200
                    , 6200, 6200, 6200, 6200, 6200, 6200)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6680, netSellCostBuyPrice = netSellCostBuyPrice+6200
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6200
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6200
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6200
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6200
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6200
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6200
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+6200;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd76ab483f and sellbillId = 57 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:41:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:11:13", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:11:13', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2360
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:41:19";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:11:19", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-02 19:11:19', '4', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=2361
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:42:27";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:12:27", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:12:27', '4', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2362
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:48:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:18:58", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:18:58', '3', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2363

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfd1add94d4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:18:58', '06abfd1add94d4', '1', '0.00', '0', '270', '1', '41770.00', '41500', '41500', '0', '1', '2026-10-02 19:18:58', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '238' ,'0','','','','','-1','0','0','0','0','0','41500','0','','0','0','41500','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=58
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,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','58', '0', '2026-10-02 19:18:58', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '41500', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:18:58','0','0','',''); -- id=134
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('375','08144', '58', '71', '1244', '20', '250', '5000', '0', '', '0', '2026-10-02 19:18:58', '1244', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','250','5000','0','','0','0.00','0','0','0','0'); -- id=264
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 370.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 365
                where sellbilldetailid = 264;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1244, '2026-10-02', 4967.68015322, 7500, 7300
                    , 7400, 7300, 7400, 7300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 7400, 7400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4967.68015322, sellCostBuyPrice =sellCostBuyPrice+7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+20
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 4967.68015322, 7500, 7300
                    , 7400, 7300, 7400, 7300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7400, 7400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4967.68015322, sellCostBuyPrice =sellCostBuyPrice+7500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '16', userid = '3', storedetaildate = '2026-10-02 19:18:58' WHERE storedetailid = '1244';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1244', '1', '20', '1', '58', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '16', '3', '2026-10-02 19:18:58','0','0'); -- id=1961
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','09572', '58', '48', '1180', '21', '250', '5250', '0', '', '0', '2026-10-02 19:18:58', '1180', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','250','5250','0','','0','0.00','0','0','0','0'); -- id=265
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 265;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1180, '2026-10-02', 5216.064160881, 6930, 6930
                    , 6930, 6930, 6930, 6930
                    , 0, 0, 0, 0
                    , 0, 0, 0, 21, 0, 6930, 6930, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5216.064160881, sellCostBuyPrice =sellCostBuyPrice+6930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6930, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6930
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6930, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6930
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6930
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6930
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6930
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+21
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 5216.064160881, 6930, 6930
                    , 6930, 6930, 6930, 6930
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6930, 6930, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5216.064160881, sellCostBuyPrice =sellCostBuyPrice+6930
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6930, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6930
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6930, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6930
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6930
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6930
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6930
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '3', storedetaildate = '2026-10-02 19:18:58' WHERE storedetailid = '1180';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1180', '1', '21', '1', '58', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '12', '3', '2026-10-02 19:18:58','0','0'); -- id=1962
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+136 where id = 63;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('190','i0001247', '58', '71', '1247', '197', '160', '31520', '0', '', '0', '2026-10-02 19:18:58', '1247', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','63-136,','1','1','0','0','160','31520','0','','0','0.00','0','0','0','0'); -- id=266
UPDATE sellbilldetail SET  lastbuyprice = 190.00 , meanbuyprice = 189.56, lastbuyprice_withDiscount = 190.00, meanbuyprice_withDiscount = 189.56
        , lastbuyprice_withTax = 190, meanbuyprice_withTax = 189.56, lastbuyprice_withDiscountAndTax = 190
                where sellbilldetailid = 266;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1247, '2026-10-02', 31316.255685899, 37430, 37430
                    , 37343.32, 37430, 37343.32, 37430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 197, 0, 37430, 37343.32, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+31316.255685899, sellCostBuyPrice =sellCostBuyPrice+37430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+37430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+37343.32
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+37430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+37343.32
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+37430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+37430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+37343.32
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+197
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 31316.255685899, 37430, 37430
                    , 37343.32, 37430, 37343.32, 37430
                    , 0, 0, 0, 0
                    , 0, 0, 0, 37430, 37343.32, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+31316.255685899, sellCostBuyPrice =sellCostBuyPrice+37430
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+37430, sellCostMeanBuyPrice = sellCostMeanBuyPrice+37343.32
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+37430, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+37343.32
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+37430
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+37430
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+37343.32
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '3', storedetaildate = '2026-10-02 19:18:58' WHERE storedetailid = '1247';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1247', '1', '197', '1', '58', 'اضافة فاتورة مبيعات', 'sellbillController.php', '202', '5', '3', '2026-10-02 19:18:58','0','0'); -- id=1963
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '200215',  userid = '3' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('158715','41500', '0', '2', 'اضافة فاتورة مبيعات', '58', '200215', '2026-10-02 19:18:58', '3',  'sellbillController.php','1','','0'); -- id=76
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '41770', '41770', '2026-10-02', '3', '0', '0', '2026-10-02 19:18:58','اضافة فاتورة مبيعات رقم 58','1','0',null,'0','58','sellbillController.php?do=showDetail&sellbillid=58'); -- id=1032
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1032', '419', '41500', '','0'); -- id=1034
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '200215', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1032', '398', '270', '','0'); -- id=1035
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '130738', theOrder = '0', layingOrder = '51', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-08-08 17:58:26' WHERE id = '398';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1032', '143', '41770', '','0'); -- id=1032
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '640435', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '51660', '51660', '2026-10-02', '3', '0', '0', '2026-10-02 19:18:58','اضافة فاتورة مبيعات رقم 58 - صرف البضاعة من المخزن','1','0',null,'0','58','sellbillController.php?do=showDetail&sellbillid=58'); -- id=1033
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1033', '402', '51660', '','0'); -- id=1036
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '631014.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1033', '382', '51660', '','0'); -- id=1033
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14114969.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='1032,0,1033' where sellbillid=58;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 41500, 51860, 51660
                    , 51673.32, 51660, 51673.32, 51660
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,51760, 51673.32, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+41500, sellCostBuyPrice =sellCostBuyPrice+51860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+51660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+51673.32
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+51660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+51673.32
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+51660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+51760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+51673.32
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 41500, 51860, 51660
                    , 51673.32, 51660, 51673.32, 51660
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,51760, 51673.32, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+41500, sellCostBuyPrice =sellCostBuyPrice+51860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+51660, sellCostMeanBuyPrice = sellCostMeanBuyPrice+51673.32
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+51660, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+51673.32
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+51660
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+51760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+51673.32
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 41500, 51860, 51660
                    , 51673.32, 51660, 51673.32, 51660, 51760, 51673.32)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+41500, netSellCostBuyPrice = netSellCostBuyPrice+51860
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+51660
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+51673.32
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+51660
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+51673.32
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+51660
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+51760
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+51673.32;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfd1add94d4 and sellbillId = 58 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 15:48:58";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:18:58", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:18:58', '3', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2364
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 16:00:16";
update user set blockedByLimits = 0;
INSERT IGNORE INTO relusergroupproperties (usergroupid, propertyid, propertyvalue, theorder)
                SELECT -1,propertyid , 0,0
                from properties; -- id=0
INSERT IGNORE INTO usergroupadmin (propertyid, isallowed)
                SELECT propertyid , propertydefault
                from properties; -- id=0
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 16:02:00";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:32:00", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-02 19:32:00', '3', '', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=2365
UPDATE product SET lastbuyprice=productBuyPrice,lastbuyprice_withDiscount=productBuyPrice,meanbuyprice=productBuyPrice,meanbuyprice_withDiscount=productBuyPrice where lastbuyprice is null;
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 < "2026-10-02 16:02:00";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-02 19:32:00', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=2366
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 16:02:10";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:32:10", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:32:10', '3', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2367
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 16:09:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:39:13", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:39:13', '3', 'addAndRetuen', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=2368

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06abfdc8a99105
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,tax ,carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,obygyVisitId,onlineOrderId,delbyuserid,delivery,totalafterdelivery,billReservation,billReservationDate,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,qrerpid,qrerpids,autoSaveFlag,ereason,estatus,epdf,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,sellbilltypeclientid,shipfrom,shipto,paymethodshipping,whatShippingCost,clientaddress,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-02 19:39:13', '06abfdc8a99105', '1', '0.00', '0', '0', '1', '4600.00', '4600', '4600', '0', '1', '2026-10-02 19:39:13', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '15' ,'0','','','','','-1','0','0','0','0','0','4600','0','','0','0','4600','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-02','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','','','','0','0','0',''); -- id=59
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,userSelectedDate,paySerialNo,totalpayments,tagids,file) VALUES ('1','0.00','0','0','اضافة فاتورة مبيعات','59', '0', '2026-10-02 19:39:13', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4600', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-02 19:39:13','0','0','',''); -- id=135
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('200','08595', '59', '84', '1315', '5', '220', '1100', '0', '', '0', '2026-10-02 19:39:13', '1315', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','220','1100','0','','0','0.00','0','0','0','0'); -- id=267
UPDATE sellbilldetail SET  lastbuyprice = 200.00 , meanbuyprice = 200.00, lastbuyprice_withDiscount = 200.00, meanbuyprice_withDiscount = 200.00
        , lastbuyprice_withTax = 200, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 200
                where sellbilldetailid = 267;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1315, '2026-10-02', 1100, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1100, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+5
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 1100, 1000, 1000
                    , 1000, 1000, 1000, 1000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1000, 1000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1100, sellCostBuyPrice =sellCostBuyPrice+1000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '67', userid = '3', storedetaildate = '2026-10-02 19:39:13' WHERE storedetailid = '1315';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1315', '1', '5', '1', '59', 'اضافة فاتورة مبيعات', 'sellbillController.php', '72', '67', '3', '2026-10-02 19:39:13','0','0'); -- id=1964
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('330','09767', '59', '25', '900', '10', '350', '3500', '0', '', '0', '2026-10-02 19:39:13', '900', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','350','3500','0','','0','0.00','0','0','0','0'); -- id=268
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 268;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (900, '2026-10-02', 3500, 3300, 3300
                    , 3300, 3300, 3300, 3300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3500, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+10
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 3500, 3300, 3300
                    , 3300, 3300, 3300, 3300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3500, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '60', userid = '3', storedetaildate = '2026-10-02 19:39:13' WHERE storedetailid = '900';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('900', '1', '10', '1', '59', 'اضافة فاتورة مبيعات', 'sellbillController.php', '70', '60', '3', '2026-10-02 19:39:13','0','0'); -- id=1965
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '204815',  userid = '3' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('200215','4600', '0', '2', 'اضافة فاتورة مبيعات', '59', '204815', '2026-10-02 19:39:13', '3',  'sellbillController.php','1','','0'); -- id=77
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4600', '4600', '2026-10-02', '3', '0', '0', '2026-10-02 19:39:13','اضافة فاتورة مبيعات رقم 59','1','0',null,'0','59','sellbillController.php?do=showDetail&sellbillid=59'); -- id=1034
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1034', '419', '4600', '','0'); -- id=1037
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '204815', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-27 18:07:37' WHERE id = '419';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1034', '143', '4600', '','0'); -- id=1034
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '645035', theOrder = '0', layingOrder = '410101', reportid = '2', listId = '2', notes = '', itemfrom = '0', itemtype = '2', itemtype2 = '0', itemtype3 = 'Income ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:40' WHERE id = '143';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4300', '4300', '2026-10-02', '3', '0', '0', '2026-10-02 19:39:13','اضافة فاتورة مبيعات رقم 59 - صرف البضاعة من المخزن','1','0',null,'0','59','sellbillController.php?do=showDetail&sellbillid=59'); -- id=1035
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1035', '402', '4300', '','0'); -- id=1038
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '635314.6', theOrder = '0', layingOrder = '530101', reportid = '2', listId = '2', notes = '', itemfrom = '1', itemtype = '5', itemtype2 = '0', itemtype3 = '', userid = '1', del = '0', sysdate = '2023-07-25 23:37:18' WHERE id = '402';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('1035', '382', '4300', '','0'); -- id=1035
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '14110669.4', theOrder = '0', layingOrder = '120202', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2022-05-08 23:13:11' WHERE id = '382';
update sellbill set dailyentryid='1034,0,1035' where sellbillid=59;
 INSERT INTO quickprofitday (theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES ('2026-10-02', 4600, 4300, 4300
                    , 4300, 4300, 4300, 4300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4300, 4300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4600, sellCostBuyPrice =sellCostBuyPrice+4300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-02', 4600, 4300, 4300
                    , 4300, 4300, 4300, 4300
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4300, 4300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4600, sellCostBuyPrice =sellCostBuyPrice+4300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 4600, 4300, 4300
                    , 4300, 4300, 4300, 4300, 4300, 4300)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4600, netSellCostBuyPrice = netSellCostBuyPrice+4300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4300
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4300
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4300
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4300
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4300
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4300;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06abfdc8a99105 and sellbillId = 59 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-02 16:09:13";
UPDATE user SET loginip = "156.196.79.176", lastactivetime = "2026-10-02 19:39:13", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-02 19:39:13', '3', 'addsellBill', '156.196.79.176', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=2369
