UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-19 23:25:00";
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 = '7', 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-19',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='0',showpriceunit='0',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-20 04:44:36";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 08:14:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 08:14:36', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15008
UPDATE programsettings SET companyname = 'سنتر احمد العربي', address = 'ش الترعة البولاقيه - امام قسم شبرا - مول العتبه', specializtion = 'ملابس جملة', phone = '01064062900', faxnumber = '', email = '', website = '', logo = '4a754be7e82553f312ecf932e16cce7d.jpg', roundnumbers = '1', saveprinting = '1', deptprinting = '1', printingpapersize = '0', userid = '7', 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-20',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='0',showpriceunit='0',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-20 04:44:36";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 08:14:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 08:14:36', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15009
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 04:44:39";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 08:14:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 08:14:39', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15010
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 04:48:12";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 04:51:50";
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-20 05:02:44";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 08:32:44", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 08:32:44', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15011
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-20 05:02:44";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 08:32:44', '5', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15012
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-20 05:32:06";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:02:06", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 09:02:06', '7', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15013
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-20 05:32:06";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 09:02:06', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15014
UPDATE user SET loginip = "" WHERE userid = 5;
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-20 06:01:25";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:31:25", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 09:31:25', '3', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15015
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-20 06:01:25";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 09:31:25', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15016
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:01:31";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:31:31", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 09:31:31', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15017
UPDATE user SET loginip = "" WHERE userid = 7;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:18:19";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:48:19", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 09:48:19', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15018
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:18:19";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:48:19", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 09:48:19', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15019
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:24:43";
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:24:55";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:54:55", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 09:54:55', '3', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15020
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-20 06:24:55";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 09:54:55', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15021
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-20 06:25:00";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:55:00", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 09:55:00', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15022
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-20 06:25:00";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 09:55:00', '5', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15023
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:25:01";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:55:01", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 09:55:01', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15024
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:25:02";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:55:02", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 09:55:02', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15025
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:25:04";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:55:04", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 09:55:04', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=15026
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:25:46";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:55:46", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 09:55:46', '3', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15027

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad70eb358944
-- ----------------------------------------------------------------------------------------------------

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-20 09:55:46', '06ad70eb358944', '1', '0.00', '0', '0', '1', '12170.00', '12170', '12170', '0', '1', '2026-10-20 09:55:46', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '31' ,'0','','','','','-1','0','0','0','0','0','12170','0','','0','0','12170','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1093
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','اضافة فاتورة مبيعات','1093', '0', '2026-10-20 09:55:47', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '12170', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 09:55:46','0','0','',''); -- id=1308
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 560;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('405','01696', '1093', '129', '1696', '3', '450', '1350', '0', '', '0', '2026-10-20 09:55:47', '1696', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','560-3,','1','1','0','0','450','1350','0','','0','0.00','0','0','0','0'); -- id=4363
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 4363;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1696, '2026-10-20', 1350, 1350, 1350
                    , 1350, 1215, 1215, 1215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1350, 1350, 1350
                    , 1350, 1215, 1215, 1215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '84', userid = '3', storedetaildate = '2026-10-20 09:55:47' WHERE storedetailid = '2708';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1696', '1', '3', '1', '1093', 'اضافة فاتورة مبيعات', 'sellbillController.php', '87', '84', '3', '2026-10-20 09:55:47','0','0'); -- id=15152
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6645;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','02242', '1093', '72', '2242', '3', '340', '1020', '0', '', '0', '2026-10-20 09:55:47', '2242', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6645-3,','1','1','0','0','340','1020','0','','0','0.00','0','0','0','0'); -- id=4364
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 306.00, meanbuyprice_withDiscount = 306.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 306
                where sellbilldetailid = 4364;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2242, '2026-10-20', 1020, 1020, 1020
                    , 1020, 918, 918, 918
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1020, 1020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1020, sellCostBuyPrice =sellCostBuyPrice+1020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1020, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1020
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+918, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+918
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+918
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1020
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1020, 1020, 1020
                    , 1020, 918, 918, 918
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1020, 1020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1020, sellCostBuyPrice =sellCostBuyPrice+1020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1020, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1020
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+918, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+918
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+918
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1020
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '42', userid = '3', storedetaildate = '2026-10-20 09:55:47' WHERE storedetailid = '3633';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2242', '1', '3', '1', '1093', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '42', '3', '2026-10-20 09:55:47','0','0'); -- id=15153
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 1166;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','01972', '1093', '59', '1972', '3', '330', '990', '0', '', '0', '2026-10-20 09:55:47', '1972', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1166-3,','1','1','0','0','330','990','0','','0','0.00','0','0','0','0'); -- id=4365
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 4365;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1972, '2026-10-20', 990, 960, 960
                    , 960, 960, 960, 960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 960, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 990, 960, 960
                    , 960, 960, 960, 960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 960, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '3', storedetaildate = '2026-10-20 09:55:47' WHERE storedetailid = '2989';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1972', '1', '3', '1', '1093', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '45', '3', '2026-10-20 09:55:47','0','0'); -- id=15154
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6645;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','02242', '1093', '72', '2242', '3', '340', '1020', '0', '', '0', '2026-10-20 09:55:47', '2242', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6645-3,','1','1','0','0','340','1020','0','','0','0.00','0','0','0','0'); -- id=4366
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 306.00, meanbuyprice_withDiscount = 306.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 306
                where sellbilldetailid = 4366;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2242, '2026-10-20', 1020, 1020, 1020
                    , 1020, 918, 918, 918
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1020, 1020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1020, sellCostBuyPrice =sellCostBuyPrice+1020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1020, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1020
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+918, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+918
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+918
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1020
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1020, 1020, 1020
                    , 1020, 918, 918, 918
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1020, 1020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1020, sellCostBuyPrice =sellCostBuyPrice+1020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1020, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1020
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+918, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+918
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+918
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1020
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '39', userid = '3', storedetaildate = '2026-10-20 09:55:47' WHERE storedetailid = '3633';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2242', '1', '3', '1', '1093', 'اضافة فاتورة مبيعات', 'sellbillController.php', '42', '39', '3', '2026-10-20 09:55:47','0','0'); -- id=15155
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 1166;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','01972', '1093', '59', '1972', '3', '330', '990', '0', '', '0', '2026-10-20 09:55:47', '1972', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1166-3,','1','1','0','0','330','990','0','','0','0.00','0','0','0','0'); -- id=4367
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 4367;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1972, '2026-10-20', 990, 960, 960
                    , 960, 960, 960, 960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 960, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 990, 960, 960
                    , 960, 960, 960, 960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 960, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+990, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '42', userid = '3', storedetaildate = '2026-10-20 09:55:47' WHERE storedetailid = '2989';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1972', '1', '3', '1', '1093', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '42', '3', '2026-10-20 09:55:47','0','0'); -- id=15156
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 where id = 6080;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','i0002048', '1093', '42', '2048', '16', '425', '6800', '0', '', '0', '2026-10-20 09:55:47', '2048', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6080-16,','1','1','0','0','425','6800','0','','0','0.00','0','0','0','0'); -- id=4368
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 = 4368;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2048, '2026-10-20', 6800, 6560, 6560
                    , 6560, 6560, 6560, 6560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 6560, 6560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+6560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (1, '2026-10-20', 6800, 6560, 6560
                    , 6560, 6560, 6560, 6560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6560, 6560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+6560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+6560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '3', storedetaildate = '2026-10-20 09:55:47' WHERE storedetailid = '3407';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2048', '1', '16', '1', '1093', 'اضافة فاتورة مبيعات', 'sellbillController.php', '43', '27', '3', '2026-10-20 09:55:47','0','0'); -- id=15157
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6767108.5',  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 ('6754938.5','12170', '0', '2', 'اضافة فاتورة مبيعات', '1093', '6767108.5', '2026-10-20 09:55:47', '3',  'sellbillController.php','1','','0'); -- id=1352
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '12170', '12170', '2026-10-20', '3', '0', '0', '2026-10-20 09:55:47','اضافة فاتورة مبيعات رقم 1093','1','0',null,'0','1093','sellbillController.php?do=showDetail&sellbillid=1093'); -- id=3904
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3904', '419', '12170', '','0'); -- id=4007
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6767108', 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 ('3904', '143', '12170', '','0'); -- id=3906
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12394165', 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 ( '11531', '11531', '2026-10-20', '3', '0', '0', '2026-10-20 09:55:47','اضافة فاتورة مبيعات رقم 1093 - صرف البضاعة من المخزن','1','0',null,'0','1093','sellbillController.php?do=showDetail&sellbillid=1093'); -- id=3905
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3905', '402', '11531', '','0'); -- id=4008
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11468908.81', 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 ('3905', '382', '11531', '','0'); -- id=3907
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23728922.39', 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='3904,0,3905' where sellbillid=1093;
 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-20', 12170, 11870, 11870
                    , 11870, 11531, 11531, 11531
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11870, 11870, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12170, sellCostBuyPrice =sellCostBuyPrice+11870
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11870, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11870
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11531, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11531
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11531
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11870
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11870
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 12170, 11870, 11870
                    , 11870, 11531, 11531, 11531
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,11870, 11870, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12170, sellCostBuyPrice =sellCostBuyPrice+11870
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+11870, sellCostMeanBuyPrice = sellCostMeanBuyPrice+11870
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11531, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11531
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11531
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+11870
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+11870
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 12170, 11870, 11870
                    , 11870, 11531, 11531, 11531, 11870, 11870)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+12170, netSellCostBuyPrice = netSellCostBuyPrice+11870
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+11870
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+11870
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+11531
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+11531
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+11531
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+11870
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+11870;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad70eb358944 and sellbillId = 1093 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:25:47";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:55:47", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 09:55:47', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15028
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:26:57";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:56:57", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 09:56:57', '5', 'add2', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=15029
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('ارمي النوبي','2026-10-20','','93', '5','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=197
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (197, 1,'2026-10-20 09:56:57',5)
                ON DUPLICATE KEY UPDATE catid = 197, edited = 1, sysdate = '2026-10-20 09:56:57', userid = 5; -- id=212
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:26:57";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:56:57", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 09:56:57', '5', 'sucess', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=15030
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:26:59";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:56:59", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 09:56:59', '5', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=15031
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:27:01";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:57:01", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 09:57:01', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15032
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:27:03";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:57:03", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 09:57:03', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15033
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:28:25";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:58:25", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 09:58:25', '5', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15034
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('روند ارمي النوبي ','','197','400','400','0','0','2026-10-20','0','5','0','','0','0','0','0','0','400','400','400','400','400','0','0','0','0','.','0','0','0','400','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','400','400','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','400','0','0','0','0','0','0','','','0','0','0','0'); -- id=2253
UPDATE product SET productName = 'روند ارمي النوبي ', productDescription = '', productCatId = '197', productBuyPrice = '400', productSellAllPrice = '400', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02253',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '400' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2253';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2253', '1', '2026-10-20', '5', '0','0225301','400','0','0','400','','0','0','0','0','0','0','0','0','0','0'); -- id=2253
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2253', '1', '0', '5', '2026-10-20'); -- id=3644
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2253', '1', '0', '0', '2253', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15158
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2253, 1,'2026-10-20 09:58:25',5)
                ON DUPLICATE KEY UPDATE productid = 2253, edited = 1, sysdate = '2026-10-20 09:58:25', userid = 5; -- id=3291
UPDATE product SET productName = 'روند ارمي النوبي ', productDescription = '', productCatId = '197', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02253',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '400' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2253';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('سوسته ارمي النوبي ','','197','585','585','0','0','2026-10-20','0','5','0','','0','0','0','0','0','585','585','585','585','585','0','0','0','0','.','0','0','0','585','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','585','585','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','585','0','0','0','0','0','0','','','0','0','0','0'); -- id=2254
UPDATE product SET productName = 'سوسته ارمي النوبي ', productDescription = '', productCatId = '197', productBuyPrice = '585', productSellAllPrice = '585', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02254',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '585',lastbuyprice_withDiscount = '585',meanbuyprice = '585',meanbuyprice_withDiscount = '585' , productbuypricereal = '585' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='585',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='585',meanbuyprice_withTax='585',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='585',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2254';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2254', '1', '2026-10-20', '5', '0','0225401','585','0','0','585','','0','0','0','0','0','0','0','0','0','0'); -- id=2254
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2254', '1', '0', '5', '2026-10-20'); -- id=3645
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2254', '1', '0', '0', '2254', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15159
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2254, 1,'2026-10-20 09:58:25',5)
                ON DUPLICATE KEY UPDATE productid = 2254, edited = 1, sysdate = '2026-10-20 09:58:25', userid = 5; -- id=3292
UPDATE product SET productName = 'سوسته ارمي النوبي ', productDescription = '', productCatId = '197', productBuyPrice = '585.00', productSellAllPrice = '585.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02254',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '585',lastbuyprice_withDiscount = '585',meanbuyprice = '585',meanbuyprice_withDiscount = '585' , productbuypricereal = '585' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='585',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='585',meanbuyprice_withTax='585',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='585',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2254';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:28:27";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:58:27", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 09:58:27', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15035
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:28:29";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 09:58:29", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 09:58:29', '5', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15036
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:30:38";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:00:39", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:00:39', '5', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15037
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:32:51";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:33:00";
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-20 06:33:04";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:03:04", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 10:03:04', '6', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15038
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-20 06:33:04";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 10:03:04", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 10:03:04', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15039
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:33:18";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:03:18", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:03:18', '5', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15040
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:33:28";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:33:32";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:03:32", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:03:32', '6', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15041
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-20 06:33:44";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:03:44", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 10:03:44', '7', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15042
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-20 06:33:44";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 10:03:44', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15043
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:33:51";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:03:51", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:03:51', '7', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15044
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:33:59";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:03:59", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:03:59', '5', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15045
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:34:24";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:04:24", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:04:24', '7', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15046
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', '5', '2026-10-20 10:04:33', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=195
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 ('195', '0', '', '0', 'إضافة مورد جديد', '195', '', '2026-10-20 10:04:33', '5', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=737
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', '', '5', '0', '2026-10-20 10:04:33'); -- id=682
UPDATE supplier SET suppliername = 'ارمي النوبي', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '5', supplierdate = '2026-10-20', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='682',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '195';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:36:45";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:06:45", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:06:45', '5', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15047
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 ('06ad7125f1d799', '2026-10-20 10:03:59', '195', '0.00', '51192', '10', '1', '56880.00',  '51192.00', '0', '51192', '1', '2026-10-20 10:06:45', '', '5', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=258
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 ('02253', '258', '197', '2253', '72', '400', '28800.00', '0', '', '2026-10-20 10:06:45', '2253','','','0','0','0','0','0',null,'400','28800','0','0','0','0','0','0','0','0','1'); -- id=1464
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:03:59', 1, 2253, 0, 0
                    , 360, 72, 0, 0, 5, '2026-10-20 10:06:45')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:06:45' ; -- id=6712
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2253', '400', '72', '0', 'buyBillController.php', '1464', '', '0', '0'); -- id=1077
UPDATE product SET  productBuyPrice = "400" WHERE productId = 2253 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1464 ;
UPDATE product SET productName = 'روند ارمي النوبي ', productDescription = '', productCatId = '197', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02253',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '360',meanbuyprice = '400',meanbuyprice_withDiscount = '360' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2253';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 360
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 1464;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 2253;
UPDATE storedetail SET  productquantity = '72', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3644';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2253', '1', '72', '0', '258', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '72', '5', '2026-10-20 10:03:59','0','0'); -- id=15160
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 ('02254', '258', '197', '2254', '48', '585', '28080.00', '0', '', '2026-10-20 10:06:45', '2254','','','0','0','0','0','0',null,'585','28080','0','0','0','0','0','0','0','0','1'); -- id=1465
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:03:59', 1, 2254, 0, 0
                    , 526.5, 48, 0, 0, 5, '2026-10-20 10:06:45')
                ON DUPLICATE KEY UPDATE buyprice = 526.5,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:06:45' ; -- id=6713
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2254', '585', '48', '0', 'buyBillController.php', '1465', '', '0', '0'); -- id=1078
UPDATE product SET  productBuyPrice = "585" WHERE productId = 2254 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1465 ;
UPDATE product SET productName = 'سوسته ارمي النوبي ', productDescription = '', productCatId = '197', productBuyPrice = '585.00', productSellAllPrice = '585.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02254',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '585',lastbuyprice_withDiscount = '526.5',meanbuyprice = '585',meanbuyprice_withDiscount = '526.5' , productbuypricereal = '585.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='585',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='585',meanbuyprice_withTax='585',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='526.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2254';
UPDATE buybilldetail SET  lastbuyprice = 585 , meanbuyprice = 585, lastbuyprice_withDiscount = 526.5, meanbuyprice_withDiscount = 526.5
        , lastbuyprice_withTax = 585, meanbuyprice_withTax = 585, lastbuyprice_withDiscountAndTax = 526.5
                where buybilldetailid = 1465;
UPDATE productunit SET proUnitBuyPrice  = 585 * productnumber WHERE productid = 2254;
UPDATE storedetail SET  productquantity = '48', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3645';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2254', '1', '48', '0', '258', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '48', '5', '2026-10-20 10:03:59','0','0'); -- id=15161
UPDATE supplier SET  suppliercurrentDebt = '51192',suppliercurrentDebtInCurrency= '51192' , userid = '5', supplierdate = '2026-10-20 10:06:45'   WHERE supplierid = '195';
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 ('195', '0.00', '51192', '0', 'اضافة فاتورة مشتريات', '258', '51192', '2026-10-20 10:03:59', '5', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','51192','1','0','51192','51192','0',''); -- id=738
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '51192', '51192', '2026-10-20', '5', '0', '0', '2026-10-20 10:06:45','اضافة فاتورة مشتريات رقم 258','1','0',null,'0','258','buyBillController.php?do=details&id=258'); -- id=3906
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3906', '382', '51192', '','0'); -- id=4009
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23780114.39', 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 ('3906', '682', '51192', '','0'); -- id=3908
UPDATE accountstree SET name = 'ارمي النوبي', customName = 'ارمي النوبي', customNameEn = 'ارمي النوبي', nameEn = 'ارمي النوبي', parent = '81', accountNature = '1', theValue = '51192', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '5', del = '0', sysdate = '2026-10-20 10:04:33' WHERE id = '682';
update buybill set dailyentryid='3906,0' where buybillid=258;
COMMIT;
UPDATE product SET overAllAveragePrice = 360 WHERE productId = 2253;UPDATE product SET overAllAveragePrice = 526.5 WHERE productId = 2254;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:36:45";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:06:45", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:06:45', '5', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=258'); -- id=15048
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:37:05";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:07:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 10:07:05', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15049
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-20 06:37:05";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 10:07:05", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 10:07:05', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15050
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:37:09";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:07:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:07:09', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15051

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad6f8bf8dbd1
-- ----------------------------------------------------------------------------------------------------

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-20 10:07:09', '06ad6f8bf8dbd1', '1', '0.00', '0', '0', '1', '17880.00', '17880', '17880', '0', '1', '2026-10-20 10:07:09', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '45' ,'0','','','','','-1','0','0','0','0','0','17880','0','','0','0','17880','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1094
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','اضافة فاتورة مبيعات','1094', '0', '2026-10-20 10:07:09', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '17880', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 10:07:09','0','0','',''); -- id=1309
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6424;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('432.4','02199', '1094', '173', '2199', '9', '470', '4230', '0', '', '0', '2026-10-20 10:07:09', '2199', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6424-9,','1','1','0','0','470','4230','0','','0','0.00','0','0','0','0'); -- id=4369
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 432.40, meanbuyprice_withDiscount = 432.40
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 432.4
                where sellbilldetailid = 4369;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2199, '2026-10-20', 4230, 4230, 4230
                    , 4230, 3891.6, 3891.6, 3891.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4230, 4230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4230, sellCostBuyPrice =sellCostBuyPrice+4230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3891.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3891.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3891.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4230, 4230, 4230
                    , 4230, 3891.6, 3891.6, 3891.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4230, 4230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4230, sellCostBuyPrice =sellCostBuyPrice+4230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3891.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3891.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3891.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '2', storedetaildate = '2026-10-20 10:07:09' WHERE storedetailid = '3568';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2199', '1', '9', '1', '1094', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '30', '2', '2026-10-20 10:07:09','0','0'); -- id=15162
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6077;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02045', '1094', '42', '2045', '12', '385', '4620', '0', '', '0', '2026-10-20 10:07:09', '2045', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6077-12,','1','1','0','0','385','4620','0','','0','0.00','0','0','0','0'); -- id=4370
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 = 4370;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2045, '2026-10-20', 4620, 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+4620, 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 (1, '2026-10-20', 4620, 4440, 4440
                    , 4440, 4440, 4440, 4440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4440, 4440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4620, 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 = '2', storedetaildate = '2026-10-20 10:07:09' WHERE storedetailid = '3404';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2045', '1', '12', '1', '1094', 'اضافة فاتورة مبيعات', 'sellbillController.php', '32', '20', '2', '2026-10-20 10:07:09','0','0'); -- id=15163
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 1221;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01995', '1094', '78', '1995', '12', '395', '4740', '0', '', '0', '2026-10-20 10:07:09', '1995', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1221-12,','1','1','0','0','395','4740','0','','0','0.00','0','0','0','0'); -- id=4371
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 = 4371;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1995, '2026-10-20', 4740, 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+4740, 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 (1, '2026-10-20', 4740, 4440, 4440
                    , 4440, 4440, 4440, 4440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4440, 4440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4740, 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 = '56', userid = '2', storedetaildate = '2026-10-20 10:07:09' WHERE storedetailid = '3012';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1995', '1', '12', '1', '1094', 'اضافة فاتورة مبيعات', 'sellbillController.php', '68', '56', '2', '2026-10-20 10:07:09','0','0'); -- id=15164
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6128;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02083', '1094', '43', '2083', '3', '350', '1050', '0', '', '0', '2026-10-20 10:07:09', '2083', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6128-3,','1','1','0','0','350','1050','0','','0','0.00','0','0','0','0'); -- id=4372
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 4372;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2083, '2026-10-20', 1050, 1050, 1050
                    , 1050, 945, 945, 945
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1050, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+945, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+945
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+945
                            , 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 (1, '2026-10-20', 1050, 1050, 1050
                    , 1050, 945, 945, 945
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1050, 1050, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1050, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+945, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+945
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+945
                            , 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 = '21', userid = '2', storedetaildate = '2026-10-20 10:07:09' WHERE storedetailid = '3442';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2083', '1', '3', '1', '1094', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '21', '2', '2026-10-20 10:07:09','0','0'); -- id=15165
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6167;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('331.2','02104', '1094', '179', '2104', '9', '360', '3240', '0', '', '0', '2026-10-20 10:07:09', '2104', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6167-9,','1','1','0','0','360','3240','0','','0','0.00','0','0','0','0'); -- id=4373
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 331.20, meanbuyprice_withDiscount = 331.20
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 331.2
                where sellbilldetailid = 4373;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2104, '2026-10-20', 3240, 3240, 3240
                    , 3240, 2980.8, 2980.8, 2980.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3240, 3240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3240, sellCostBuyPrice =sellCostBuyPrice+3240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2980.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2980.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2980.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 3240, 3240, 3240
                    , 3240, 2980.8, 2980.8, 2980.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3240, 3240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3240, sellCostBuyPrice =sellCostBuyPrice+3240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2980.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2980.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2980.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '99', userid = '2', storedetaildate = '2026-10-20 10:07:09' WHERE storedetailid = '3463';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2104', '1', '9', '1', '1094', 'اضافة فاتورة مبيعات', 'sellbillController.php', '108', '99', '2', '2026-10-20 10:07:09','0','0'); -- id=15166
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6784988.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6767108.5','17880', '0', '2', 'اضافة فاتورة مبيعات', '1094', '6784988.5', '2026-10-20 10:07:09', '2',  'sellbillController.php','1','','0'); -- id=1353
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '17880', '17880', '2026-10-20', '2', '0', '0', '2026-10-20 10:07:09','اضافة فاتورة مبيعات رقم 1094','1','0',null,'0','1094','sellbillController.php?do=showDetail&sellbillid=1094'); -- id=3907
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3907', '419', '17880', '','0'); -- id=4010
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6784988', 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 ('3907', '143', '17880', '','0'); -- id=3909
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12412045', 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 ( '16697.4', '16697.4', '2026-10-20', '2', '0', '0', '2026-10-20 10:07:09','اضافة فاتورة مبيعات رقم 1094 - صرف البضاعة من المخزن','1','0',null,'0','1094','sellbillController.php?do=showDetail&sellbillid=1094'); -- id=3908
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3908', '402', '16697.4', '','0'); -- id=4011
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11485606.21', 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 ('3908', '382', '16697.4', '','0'); -- id=3910
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23763416.99', 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='3907,0,3908' where sellbillid=1094;
 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-20', 17880, 17400, 17400
                    , 17400, 16697.4, 16697.4, 16697.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,17400, 17400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17880, sellCostBuyPrice =sellCostBuyPrice+17400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16697.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16697.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16697.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 17880, 17400, 17400
                    , 17400, 16697.4, 16697.4, 16697.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,17400, 17400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+17880, sellCostBuyPrice =sellCostBuyPrice+17400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+17400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+17400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+16697.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+16697.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+16697.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+17400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+17400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 17880, 17400, 17400
                    , 17400, 16697.4, 16697.4, 16697.4, 17400, 17400)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+17880, netSellCostBuyPrice = netSellCostBuyPrice+17400
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+17400
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+17400
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+16697.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+16697.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+16697.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+17400
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+17400;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad6f8bf8dbd1 and sellbillId = 1094 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:37:09";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:07:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:07:09', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15052
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:37:42";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:07:42", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:07:42', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=15053
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:38:11";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:08:11", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:08:11', '6', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15054

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7124477911
-- ----------------------------------------------------------------------------------------------------

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-20 10:08:11', '06ad7124477911', '1', '0.00', '0', '0', '1', '6280.00', '6280', '6280', '0', '1', '2026-10-20 10:08:11', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '8' ,'0','','','','','-1','0','0','0','0','0','6280','0','','0','0','6280','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1095
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','1095', '0', '2026-10-20 10:08:11', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6280', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 10:08:11','0','0','',''); -- id=1310
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 891;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('770','01844', '1095', '143', '1844', '4', '800', '3200', '0', '', '0', '2026-10-20 10:08:11', '1844', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','891-4,','1','1','0','0','800','3200','0','','0','0.00','0','0','0','0'); -- id=4374
UPDATE sellbilldetail SET  lastbuyprice = 770.00 , meanbuyprice = 770.00, lastbuyprice_withDiscount = 770.00, meanbuyprice_withDiscount = 770.00
        , lastbuyprice_withTax = 770, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 770
                where sellbilldetailid = 4374;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1844, '2026-10-20', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 3080, 1540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 3200, 3080, 3080
                    , 3080, 3080, 3080, 3080
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3080, 1540, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3200, sellCostBuyPrice =sellCostBuyPrice+3080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3080, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3080
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3080
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1540
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '6', storedetaildate = '2026-10-20 10:08:11' WHERE storedetailid = '2861';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1844', '1', '4', '1', '1095', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '12', '6', '2026-10-20 10:08:11','0','0'); -- id=15167
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 898;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('740','01851', '1095', '143', '1851', '4', '770', '3080', '0', '', '0', '2026-10-20 10:08:11', '1851', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','898-4,','1','1','0','0','770','3080','0','','0','0.00','0','0','0','0'); -- id=4375
UPDATE sellbilldetail SET  lastbuyprice = 740.00 , meanbuyprice = 740.00, lastbuyprice_withDiscount = 740.00, meanbuyprice_withDiscount = 740.00
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 740
                where sellbilldetailid = 4375;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1851, '2026-10-20', 3080, 2960, 2960
                    , 2960, 2960, 2960, 2960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 2960, 1480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3080, sellCostBuyPrice =sellCostBuyPrice+2960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 3080, 2960, 2960
                    , 2960, 2960, 2960, 2960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2960, 1480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3080, sellCostBuyPrice =sellCostBuyPrice+2960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-20 10:08:11' WHERE storedetailid = '2868';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1851', '1', '4', '1', '1095', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '20', '6', '2026-10-20 10:08:11','0','0'); -- id=15168
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '923220',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('916940','6280', '0', '4', 'اضافة فاتورة مبيعات', '1095', '923220', '2026-10-20 10:08:11', '6',  'sellbillController.php','1','','0'); -- id=1354
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6280', '6280', '2026-10-20', '6', '0', '0', '2026-10-20 10:08:11','اضافة فاتورة مبيعات رقم 1095','1','0',null,'0','1095','sellbillController.php?do=showDetail&sellbillid=1095'); -- id=3909
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3909', '568', '6280', '','0'); -- id=4012
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '923220', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3909', '143', '6280', '','0'); -- id=3911
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12418325', 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 ( '6040', '6040', '2026-10-20', '6', '0', '0', '2026-10-20 10:08:11','اضافة فاتورة مبيعات رقم 1095 - صرف البضاعة من المخزن','1','0',null,'0','1095','sellbillController.php?do=showDetail&sellbillid=1095'); -- id=3910
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3910', '402', '6040', '','0'); -- id=4013
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11491646.21', 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 ('3910', '382', '6040', '','0'); -- id=3912
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23757376.99', 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='3909,0,3910' where sellbillid=1095;
 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-20', 6280, 6040, 6040
                    , 6040, 6040, 6040, 6040
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6040, 3020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6280, sellCostBuyPrice =sellCostBuyPrice+6040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 6280, 6040, 6040
                    , 6040, 6040, 6040, 6040
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6040, 3020, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6280, sellCostBuyPrice =sellCostBuyPrice+6040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3020
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 6280, 6040, 6040
                    , 6040, 6040, 6040, 6040, 6040, 3020)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6280, netSellCostBuyPrice = netSellCostBuyPrice+6040
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6040
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6040
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6040
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6040
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6040
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6040
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3020;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7124477911 and sellbillId = 1095 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:38:11";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:08:11", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:08:11', '6', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15055
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:38:37";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:08:37", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:08:37', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=15056
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:39:10";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:09:10", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:09:10', '5', 'add2', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=15057
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('ثري وان','2026-10-20','','90', '5','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=198
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (198, 1,'2026-10-20 10:09:10',5)
                ON DUPLICATE KEY UPDATE catid = 198, edited = 1, sysdate = '2026-10-20 10:09:10', userid = 5; -- id=213
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:39:10";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:09:10", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:09:10', '5', 'sucess', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=15058
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:39:12";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:09:12", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:09:12', '5', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=15059
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:39:13";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:09:13", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:09:13', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15060
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:39:53";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:09:53", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:09:53', '7', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15061
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:40:02";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:10:02", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:10:02', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15062
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:43:10";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:13:10", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:13:10', '5', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15063
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديل 950 ثري وان ','','198','925','950','0','0','2026-10-20','0','5','0','','0','0','0','0','0','925','925','925','925','925','0','2.7','0','0','.','0','0','0','925','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','925','925','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','925','0','0','0','0','0','0','','','0','0','0','0'); -- id=2255
UPDATE product SET productName = 'موديل 950 ثري وان ', productDescription = '', productCatId = '198', productBuyPrice = '925', productSellAllPrice = '950', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02255',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '925',lastbuyprice_withDiscount = '925',meanbuyprice = '925',meanbuyprice_withDiscount = '925' , productbuypricereal = '925' , buypricereal_precentage = '0' , buytotal_precentage = '2.7' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='925',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='925',meanbuyprice_withTax='925',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='925',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2255';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2255', '1', '2026-10-20', '5', '0','0225501','950','0','0','925','','0','0','0','0','0','0','0','0','0','0'); -- id=2255
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2255', '1', '0', '5', '2026-10-20'); -- id=3646
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2255', '1', '0', '0', '2255', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15169
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2255, 1,'2026-10-20 10:13:10',5)
                ON DUPLICATE KEY UPDATE productid = 2255, edited = 1, sysdate = '2026-10-20 10:13:10', userid = 5; -- id=3293
UPDATE product SET productName = 'موديل 950 ثري وان ', productDescription = '', productCatId = '198', productBuyPrice = '925.00', productSellAllPrice = '950.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02255',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '925',lastbuyprice_withDiscount = '925',meanbuyprice = '925',meanbuyprice_withDiscount = '925' , productbuypricereal = '925' , buypricereal_precentage = '0' , buytotal_precentage = '2.7' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='925',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='925',meanbuyprice_withTax='925',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='925',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2255';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديل 850 ثري وان ','','198','825','850','0','0','2026-10-20','0','5','0','','0','0','0','0','0','825','825','825','825','825','0','3.03','0','0','.','0','0','0','825','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','825','825','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','825','0','0','0','0','0','0','','','0','0','0','0'); -- id=2256
UPDATE product SET productName = 'موديل 850 ثري وان ', productDescription = '', productCatId = '198', productBuyPrice = '825', productSellAllPrice = '850', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02256',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '825',lastbuyprice_withDiscount = '825',meanbuyprice = '825',meanbuyprice_withDiscount = '825' , productbuypricereal = '825' , buypricereal_precentage = '0' , buytotal_precentage = '3.03' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='825',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='825',meanbuyprice_withTax='825',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='825',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2256';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2256', '1', '2026-10-20', '5', '0','0225601','850','0','0','825','','0','0','0','0','0','0','0','0','0','0'); -- id=2256
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2256', '1', '0', '5', '2026-10-20'); -- id=3647
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2256', '1', '0', '0', '2256', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15170
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2256, 1,'2026-10-20 10:13:10',5)
                ON DUPLICATE KEY UPDATE productid = 2256, edited = 1, sysdate = '2026-10-20 10:13:10', userid = 5; -- id=3294
UPDATE product SET productName = 'موديل 850 ثري وان ', productDescription = '', productCatId = '198', productBuyPrice = '825.00', productSellAllPrice = '850.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02256',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '825',lastbuyprice_withDiscount = '825',meanbuyprice = '825',meanbuyprice_withDiscount = '825' , productbuypricereal = '825' , buypricereal_precentage = '0' , buytotal_precentage = '3.03' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='825',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='825',meanbuyprice_withTax='825',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='825',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2256';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديل 925 ثري ام ','','198','900','925','0','0','2026-10-20','0','5','0','','0','0','0','0','0','900','900','900','900','900','0','2.78','0','0','.','0','0','0','900','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','900','900','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','900','0','0','0','0','0','0','','','0','0','0','0'); -- id=2257
UPDATE product SET productName = 'موديل 925 ثري ام ', productDescription = '', productCatId = '198', productBuyPrice = '900', productSellAllPrice = '925', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02257',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '2.78' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2257';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2257', '1', '2026-10-20', '5', '0','0225701','925','0','0','900','','0','0','0','0','0','0','0','0','0','0'); -- id=2257
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2257', '1', '0', '5', '2026-10-20'); -- id=3648
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2257', '1', '0', '0', '2257', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15171
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2257, 1,'2026-10-20 10:13:10',5)
                ON DUPLICATE KEY UPDATE productid = 2257, edited = 1, sysdate = '2026-10-20 10:13:10', userid = 5; -- id=3295
UPDATE product SET productName = 'موديل 925 ثري ام ', productDescription = '', productCatId = '198', productBuyPrice = '900.00', productSellAllPrice = '925.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02257',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900' , buypricereal_precentage = '0' , buytotal_precentage = '2.78' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2257';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:43:12";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:13:12", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:13:12', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15064
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:43:13";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:13:13", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:13:13', '5', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15065
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', '5', '2026-10-20 10:13:35', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=196
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 ('196', '0', '', '0', 'إضافة مورد جديد', '196', '', '2026-10-20 10:13:35', '5', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=739
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', '', '5', '0', '2026-10-20 10:13:35'); -- id=683
UPDATE supplier SET suppliername = 'ثري وان ', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '5', supplierdate = '2026-10-20', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='683',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '196';
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410.00',lastbuyprice_withDiscount = '410',meanbuyprice = '410.00',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',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 = '1442';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1442, 1,'2026-10-20 10:13:35',7)
                ON DUPLICATE KEY UPDATE productid = 1442, edited = 1, sysdate = '2026-10-20 10:13:35', userid = 7; -- id=2206
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:43:41";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:13:41", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:13:41', '7', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15066
UPDATE product SET productName = 'حوض origian سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '380.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01443',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380.00',lastbuyprice_withDiscount = '380',meanbuyprice = '380.00',meanbuyprice_withDiscount = '380' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.89' , 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 = '1443';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1443, 1,'2026-10-20 10:14:17',7)
                ON DUPLICATE KEY UPDATE productid = 1443, edited = 1, sysdate = '2026-10-20 10:14:17', userid = 7; -- id=2207
UPDATE product SET productName = 'حوض origian سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '380.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01443',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380.00',lastbuyprice_withDiscount = '380',meanbuyprice = '380.00',meanbuyprice_withDiscount = '380' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.89' , 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 = '1443';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1443, 1,'2026-10-20 10:14:24',7)
                ON DUPLICATE KEY UPDATE productid = 1443, edited = 1, sysdate = '2026-10-20 10:14:24', userid = 7; -- id=2207
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410.00',lastbuyprice_withDiscount = '410',meanbuyprice = '410.00',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',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 = '1442';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1442, 1,'2026-10-20 10:14:26',7)
                ON DUPLICATE KEY UPDATE productid = 1442, edited = 1, sysdate = '2026-10-20 10:14:26', userid = 7; -- id=2206
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:45:19";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:15:19", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:15:19', '7', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15067
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 ('06ad714a513fa6', '2026-10-20 10:13:41', '75', '-112910.00', '-66310', '0', '0', '46600.00',  '46600.00', '0', '46600', '1', '2026-10-20 10:15:19', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=259
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 ('01443', '259', '88', '1443', '32', '380', '12160.00', '0', '', '2026-10-20 10:15:19', '1443','','','0','0','0','0','0',null,'380','12160','0','0','0','0','0','0','0','0','1'); -- id=1466
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 1, 1443, 0, 0
                    , 380, 32, 0, 0, 7, '2026-10-20 10:15:19')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-20 10:15:19' ; -- id=6714
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1443', '380', '32', '0', 'buyBillController.php', '1466', '', '0', '0'); -- id=1079
UPDATE product SET  productBuyPrice = "380" WHERE productId = 1443 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1466 ;
UPDATE product SET productName = 'حوض origian سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '380.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01443',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 = '7.89' , 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 = '1443';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 1466;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 1443;
UPDATE storedetail SET  productquantity = '32', userid = '7', storedetaildate = '2026-10-20' WHERE storedetailid = '1456';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1443', '1', '32', '0', '259', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '32', '7', '2026-10-20 10:13:41','0','0'); -- id=15172
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 ('01442', '259', '88', '1442', '24', '410', '9840.00', '0', '', '2026-10-20 10:15:19', '1442','','','0','0','0','0','0',null,'410','9840','0','0','0','0','0','0','0','0','1'); -- id=1467
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 1, 1442, 0, 0
                    , 410, 24, 0, 0, 7, '2026-10-20 10:15:19')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-20 10:15:19' ; -- id=6715
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1442', '410', '24', '0', 'buyBillController.php', '1467', '', '0', '0'); -- id=1080
UPDATE product SET  productBuyPrice = "410" WHERE productId = 1442 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1467 ;
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',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 = '1442';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 1467;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1442;
UPDATE storedetail SET  productquantity = '24', userid = '7', storedetaildate = '2026-10-20' WHERE storedetailid = '1455';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '1', '24', '0', '259', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '7', '2026-10-20 10:13:41','0','0'); -- id=15173
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 ('01442', '259', '88', '1442', '36', '410', '14760.00', '0', '', '2026-10-20 10:15:19', '1442','','','0','0','0','0','0',null,'410','14760','0','0','0','0','0','0','0','0','1'); -- id=1468
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 1, 1442, 0, 0
                    , 410, 36, 0, 0, 7, '2026-10-20 10:15:19')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-20 10:15:19' ; -- id=6715
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1442', '410', '36', '0', 'buyBillController.php', '1468', '', '0', '0'); -- id=1081
UPDATE product SET  productBuyPrice = "410" WHERE productId = 1442 ;
UPDATE buybilldetail SET  quantitybefore = 24 WHERE buybilldetailid = 1468 ;
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',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 = '1442';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 1468;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1442;
UPDATE storedetail SET  productquantity = '60', userid = '7', storedetaildate = '2026-10-20' WHERE storedetailid = '1455';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '1', '36', '0', '259', 'اضافة فاتورة مشتريات', 'buyBillController.php', '24', '60', '7', '2026-10-20 10:13:41','0','0'); -- id=15174
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 ('01442', '259', '88', '1442', '24', '410', '9840.00', '0', '', '2026-10-20 10:15:19', '1442','','','0','0','0','0','0',null,'410','9840','0','0','0','0','0','0','0','0','1'); -- id=1469
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 1, 1442, 0, 0
                    , 410, 24, 0, 0, 7, '2026-10-20 10:15:19')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-20 10:15:19' ; -- id=6715
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1442', '410', '24', '0', 'buyBillController.php', '1469', '', '0', '0'); -- id=1082
UPDATE product SET  productBuyPrice = "410" WHERE productId = 1442 ;
UPDATE buybilldetail SET  quantitybefore = 60 WHERE buybilldetailid = 1469 ;
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',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 = '1442';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 1469;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1442;
UPDATE storedetail SET  productquantity = '84', userid = '7', storedetaildate = '2026-10-20' WHERE storedetailid = '1455';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '1', '24', '0', '259', 'اضافة فاتورة مشتريات', 'buyBillController.php', '60', '84', '7', '2026-10-20 10:13:41','0','0'); -- id=15175
UPDATE supplier SET  suppliercurrentDebt = '-66310',suppliercurrentDebtInCurrency= '-66310' , userid = '7', supplierdate = '2026-10-20 10:15:19'   WHERE supplierid = '75';
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 ('75', '-112910.00', '46600', '0', 'اضافة فاتورة مشتريات', '259', '-66310', '2026-10-20 10:13:41', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','46600','1','-112910','46600','-66310','0',''); -- id=740
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '46600', '46600', '2026-10-20', '7', '0', '0', '2026-10-20 10:15:19','اضافة فاتورة مشتريات رقم 259','1','0',null,'0','259','buyBillController.php?do=details&id=259'); -- id=3911
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3911', '382', '46600', '','0'); -- id=4014
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23803976.99', 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 ('3911', '499', '46600', '','0'); -- id=3913
UPDATE accountstree SET name = 'سفنتي', customName = 'سفنتي', customNameEn = 'سفنتي', nameEn = 'سفنتي', parent = '81', accountNature = '1', theValue = '-66310', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 16:43:09' WHERE id = '499';
update buybill set dailyentryid='3911,0' where buybillid=259;
COMMIT;
UPDATE product SET overAllAveragePrice = 410 WHERE productId = 1442;UPDATE product SET overAllAveragePrice = 380 WHERE productId = 1443;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:45:20";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:15:20", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:15:20', '7', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=259'); -- id=15068
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:45:25";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:15:25", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:15:25', '7', 'showbarcodebuybill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=259&type=2'); -- id=15069
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:46:11";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:16:11", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:16:11', '5', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15070
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 ('06ad7148967093', '2026-10-20 10:13:13', '196', '0.00', '212850', '0', '0', '212850.00',  '212850.00', '0', '212850', '1', '2026-10-20 10:16:11', '', '5', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=260
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 ('02255', '260', '198', '2255', '84', '925', '77700.00', '0', '', '2026-10-20 10:16:11', '2255','','','0','0','0','0','0',null,'925','77700','0','0','0','0','0','0','0','0','1'); -- id=1470
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:13', 1, 2255, 0, 0
                    , 925, 84, 0, 0, 5, '2026-10-20 10:16:11')
                ON DUPLICATE KEY UPDATE buyprice = 925,
                        buyQuantity =buyQuantity+84, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:16:11' ; -- id=6718
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2255', '925', '84', '0', 'buyBillController.php', '1470', '', '0', '0'); -- id=1083
UPDATE product SET  productBuyPrice = "925" WHERE productId = 2255 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1470 ;
UPDATE product SET productName = 'موديل 950 ثري وان ', productDescription = '', productCatId = '198', productBuyPrice = '925.00', productSellAllPrice = '950.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02255',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '925',lastbuyprice_withDiscount = '925',meanbuyprice = '925',meanbuyprice_withDiscount = '925' , productbuypricereal = '925.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.70' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='925',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='925',meanbuyprice_withTax='925',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='925',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2255';
UPDATE buybilldetail SET  lastbuyprice = 925 , meanbuyprice = 925, lastbuyprice_withDiscount = 925, meanbuyprice_withDiscount = 925
        , lastbuyprice_withTax = 925, meanbuyprice_withTax = 925, lastbuyprice_withDiscountAndTax = 925
                where buybilldetailid = 1470;
UPDATE productunit SET proUnitBuyPrice  = 925 * productnumber WHERE productid = 2255;
UPDATE storedetail SET  productquantity = '84', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3646';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2255', '1', '84', '0', '260', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '84', '5', '2026-10-20 10:13:13','0','0'); -- id=15176
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 ('02256', '260', '198', '2256', '118', '825', '97350.00', '0', '', '2026-10-20 10:16:11', '2256','','','0','0','0','0','0',null,'825','97350','0','0','0','0','0','0','0','0','1'); -- id=1471
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:13', 1, 2256, 0, 0
                    , 825, 118, 0, 0, 5, '2026-10-20 10:16:11')
                ON DUPLICATE KEY UPDATE buyprice = 825,
                        buyQuantity =buyQuantity+118, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:16:11' ; -- id=6719
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2256', '825', '118', '0', 'buyBillController.php', '1471', '', '0', '0'); -- id=1084
UPDATE product SET  productBuyPrice = "825" WHERE productId = 2256 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1471 ;
UPDATE product SET productName = 'موديل 850 ثري وان ', productDescription = '', productCatId = '198', productBuyPrice = '825.00', productSellAllPrice = '850.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02256',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '825',lastbuyprice_withDiscount = '825',meanbuyprice = '825',meanbuyprice_withDiscount = '825' , productbuypricereal = '825.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.03' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='825',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='825',meanbuyprice_withTax='825',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='825',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2256';
UPDATE buybilldetail SET  lastbuyprice = 825 , meanbuyprice = 825, lastbuyprice_withDiscount = 825, meanbuyprice_withDiscount = 825
        , lastbuyprice_withTax = 825, meanbuyprice_withTax = 825, lastbuyprice_withDiscountAndTax = 825
                where buybilldetailid = 1471;
UPDATE productunit SET proUnitBuyPrice  = 825 * productnumber WHERE productid = 2256;
UPDATE storedetail SET  productquantity = '118', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3647';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2256', '1', '118', '0', '260', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '118', '5', '2026-10-20 10:13:13','0','0'); -- id=15177
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 ('02257', '260', '198', '2257', '42', '900', '37800.00', '0', '', '2026-10-20 10:16:11', '2257','','','0','0','0','0','0',null,'900','37800','0','0','0','0','0','0','0','0','1'); -- id=1472
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:13', 1, 2257, 0, 0
                    , 900, 42, 0, 0, 5, '2026-10-20 10:16:11')
                ON DUPLICATE KEY UPDATE buyprice = 900,
                        buyQuantity =buyQuantity+42, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:16:11' ; -- id=6720
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2257', '900', '42', '0', 'buyBillController.php', '1472', '', '0', '0'); -- id=1085
UPDATE product SET  productBuyPrice = "900" WHERE productId = 2257 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1472 ;
UPDATE product SET productName = 'موديل 925 ثري ام ', productDescription = '', productCatId = '198', productBuyPrice = '900.00', productSellAllPrice = '925.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02257',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '900',lastbuyprice_withDiscount = '900',meanbuyprice = '900',meanbuyprice_withDiscount = '900' , productbuypricereal = '900.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.78' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='900',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='900',meanbuyprice_withTax='900',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='900',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2257';
UPDATE buybilldetail SET  lastbuyprice = 900 , meanbuyprice = 900, lastbuyprice_withDiscount = 900, meanbuyprice_withDiscount = 900
        , lastbuyprice_withTax = 900, meanbuyprice_withTax = 900, lastbuyprice_withDiscountAndTax = 900
                where buybilldetailid = 1472;
UPDATE productunit SET proUnitBuyPrice  = 900 * productnumber WHERE productid = 2257;
UPDATE storedetail SET  productquantity = '42', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3648';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2257', '1', '42', '0', '260', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '42', '5', '2026-10-20 10:13:13','0','0'); -- id=15178
UPDATE supplier SET  suppliercurrentDebt = '212850',suppliercurrentDebtInCurrency= '212850' , userid = '5', supplierdate = '2026-10-20 10:16:11'   WHERE supplierid = '196';
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 ('196', '0.00', '212850', '0', 'اضافة فاتورة مشتريات', '260', '212850', '2026-10-20 10:13:13', '5', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','212850','1','0','212850','212850','0',''); -- id=741
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '212850', '212850', '2026-10-20', '5', '0', '0', '2026-10-20 10:16:11','اضافة فاتورة مشتريات رقم 260','1','0',null,'0','260','buyBillController.php?do=details&id=260'); -- id=3912
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3912', '382', '212850', '','0'); -- id=4015
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24016826.99', 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 ('3912', '683', '212850', '','0'); -- id=3914
UPDATE accountstree SET name = 'ثري وان ', customName = 'ثري وان ', customNameEn = 'ثري وان ', nameEn = 'ثري وان ', parent = '81', accountNature = '1', theValue = '212850', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '5', del = '0', sysdate = '2026-10-20 10:13:35' WHERE id = '683';
update buybill set dailyentryid='3912,0' where buybillid=260;
COMMIT;
UPDATE product SET overAllAveragePrice = 925 WHERE productId = 2255;UPDATE product SET overAllAveragePrice = 825 WHERE productId = 2256;UPDATE product SET overAllAveragePrice = 900 WHERE productId = 2257;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:46:11";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:16:11", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:16:11', '5', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=260'); -- id=15071
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:46:14";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:16:14", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:16:14', '5', 'showbarcodebuybill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=260&type=2'); -- id=15072
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:47:39";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:17:39", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:17:39', '7', 'showbarcodebuybill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=259&type=2'); -- id=15073
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:48:20";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:18:20", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:18:20', '7', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=259'); -- id=15074
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:49:00";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:49:43";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:19:43", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:19:43', '7', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15075
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:49:45";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:19:45", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:19:45', '7', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15076
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:50:08";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:20:08", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('billsettingsController.php', '2026-10-20 10:20:08', '7', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/billsettingsController.php?do=show'); -- id=15077
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:50:14";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:20:14", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:20:14', '7', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15078
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:50:25";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:20:25", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:20:25', '5', 'showbarcodebuybill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=260&type=2'); -- id=15079
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:50:25";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:20:26", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:20:26', '5', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=260'); -- id=15080
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:50:26";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:20:26", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:20:26', '5', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15081
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:50:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:20:28", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:20:28', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=15082
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:50:46";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:20:46", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:20:46', '5', 'add2', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=15083
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('مستر ام ','2026-10-20','','90', '5','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=199
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (199, 1,'2026-10-20 10:20:46',5)
                ON DUPLICATE KEY UPDATE catid = 199, edited = 1, sysdate = '2026-10-20 10:20:46', userid = 5; -- id=214
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:50:46";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:20:46", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:20:46', '5', 'sucess', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=15084
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:50:48";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:20:48", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:20:48', '5', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=15085
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:50:49";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:20:49", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:20:49', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15086
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410.00',lastbuyprice_withDiscount = '410',meanbuyprice = '410.00',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',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 = '1442';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1442, 1,'2026-10-20 10:21:21',7)
                ON DUPLICATE KEY UPDATE productid = 1442, edited = 1, sysdate = '2026-10-20 10:21:21', userid = 7; -- id=2206
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:52:45";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:22:45", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 10:22:45', '7', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15087
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-20 06:52:45";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 10:22:45', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15088
UPDATE user SET loginip = "" WHERE userid = 7;
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-20 06:52:50";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:22:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 10:22:50', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15089
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-20 06:52:50";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 10:22:50', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15090
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:54:00";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:24:00", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:24:00', '5', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15091
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('جلد شبابي مستر ام ','','199','400','420','0','0','2026-10-20','0','5','0','','0','0','0','0','0','400','400','400','400','400','0','5','0','0','.','0','0','0','400','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','400','400','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','400','0','0','0','0','0','0','','','0','0','0','0'); -- id=2258
UPDATE product SET productName = 'جلد شبابي مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '400', productSellAllPrice = '420', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02258',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '400' , buypricereal_precentage = '0' , buytotal_precentage = '5' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2258';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2258', '1', '2026-10-20', '5', '0','0225801','420','0','0','400','','0','0','0','0','0','0','0','0','0','0'); -- id=2258
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2258', '1', '0', '5', '2026-10-20'); -- id=3649
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2258', '1', '0', '0', '2258', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15179
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2258, 1,'2026-10-20 10:24:00',5)
                ON DUPLICATE KEY UPDATE productid = 2258, edited = 1, sysdate = '2026-10-20 10:24:00', userid = 5; -- id=3301
UPDATE product SET productName = 'جلد شبابي مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '400.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02258',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '400' , buypricereal_precentage = '0' , buytotal_precentage = '5' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2258';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('جلد خاص مستر ام ','','199','420','440','0','0','2026-10-20','0','5','0','','0','0','0','0','0','420','420','420','420','420','0','4.76','0','0','.','0','0','0','420','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','420','420','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','420','0','0','0','0','0','0','','','0','0','0','0'); -- id=2259
UPDATE product SET productName = 'جلد خاص مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '420', productSellAllPrice = '440', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02259',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420',lastbuyprice_withDiscount = '420',meanbuyprice = '420',meanbuyprice_withDiscount = '420' , productbuypricereal = '420' , buypricereal_precentage = '0' , buytotal_precentage = '4.76' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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 = '2259';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2259', '1', '2026-10-20', '5', '0','0225901','440','0','0','420','','0','0','0','0','0','0','0','0','0','0'); -- id=2259
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2259', '1', '0', '5', '2026-10-20'); -- id=3650
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2259', '1', '0', '0', '2259', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15180
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2259, 1,'2026-10-20 10:24:00',5)
                ON DUPLICATE KEY UPDATE productid = 2259, edited = 1, sysdate = '2026-10-20 10:24:00', userid = 5; -- id=3302
UPDATE product SET productName = 'جلد خاص مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '420.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02259',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420',lastbuyprice_withDiscount = '420',meanbuyprice = '420',meanbuyprice_withDiscount = '420' , productbuypricereal = '420' , buypricereal_precentage = '0' , buytotal_precentage = '4.76' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='420',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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 = '2259';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('بوكس فيت مستر ام ','','199','450','465','0','0','2026-10-20','0','5','0','','0','0','0','0','0','450','450','450','450','450','0','3.33','0','0','.','0','0','0','450','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','450','450','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','450','0','0','0','0','0','0','','','0','0','0','0'); -- id=2260
UPDATE product SET productName = 'بوكس فيت مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '450', productSellAllPrice = '465', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02260',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '450' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='450',meanbuyprice_withTax='450',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='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2260';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2260', '1', '2026-10-20', '5', '0','0226001','465','0','0','450','','0','0','0','0','0','0','0','0','0','0'); -- id=2260
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2260', '1', '0', '5', '2026-10-20'); -- id=3651
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2260', '1', '0', '0', '2260', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15181
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2260, 1,'2026-10-20 10:24:00',5)
                ON DUPLICATE KEY UPDATE productid = 2260, edited = 1, sysdate = '2026-10-20 10:24:00', userid = 5; -- id=3303
UPDATE product SET productName = 'بوكس فيت مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '450.00', productSellAllPrice = '465.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02260',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '450' , buypricereal_precentage = '0' , buytotal_precentage = '3.33' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='450',meanbuyprice_withTax='450',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='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2260';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('جبردين زنط مستر ام ','','199','610','635','0','0','2026-10-20','0','5','0','','0','0','0','0','0','610','610','610','610','610','0','4.1','0','0','.','0','0','0','610','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','610','610','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','610','0','0','0','0','0','0','','','0','0','0','0'); -- id=2261
UPDATE product SET productName = 'جبردين زنط مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '610', productSellAllPrice = '635', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02261',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '610',lastbuyprice_withDiscount = '610',meanbuyprice = '610',meanbuyprice_withDiscount = '610' , productbuypricereal = '610' , buypricereal_precentage = '0' , buytotal_precentage = '4.1' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='610',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='610',meanbuyprice_withTax='610',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='610',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2261';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2261', '1', '2026-10-20', '5', '0','0226101','635','0','0','610','','0','0','0','0','0','0','0','0','0','0'); -- id=2261
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2261', '1', '0', '5', '2026-10-20'); -- id=3652
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2261', '1', '0', '0', '2261', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15182
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2261, 1,'2026-10-20 10:24:00',5)
                ON DUPLICATE KEY UPDATE productid = 2261, edited = 1, sysdate = '2026-10-20 10:24:00', userid = 5; -- id=3304
UPDATE product SET productName = 'جبردين زنط مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '610.00', productSellAllPrice = '635.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02261',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '610',lastbuyprice_withDiscount = '610',meanbuyprice = '610',meanbuyprice_withDiscount = '610' , productbuypricereal = '610' , buypricereal_precentage = '0' , buytotal_precentage = '4.1' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='610',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='610',meanbuyprice_withTax='610',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='610',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2261';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:54:01";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:24:01", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:24:01', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15092
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:54:01";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:24:01", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:24:01', '5', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15093
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:54:13";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:24:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:24:13', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15094

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7131de4266
-- ----------------------------------------------------------------------------------------------------

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-20 10:24:13', '06ad7131de4266', '1', '0.00', '0', '0', '1', '2160.00', '2160', '2160', '0', '1', '2026-10-20 10:24:13', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2160','0','','0','0','2160','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1096
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','اضافة فاتورة مبيعات','1096', '0', '2026-10-20 10:24:13', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2160', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 10:24:13','0','0','',''); -- id=1311
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 70;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','01378', '1096', '94', '1378', '6', '360', '2160', '0', '', '0', '2026-10-20 10:24:13', '1378', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','70-6,','1','1','0','0','360','2160','0','','0','0.00','0','0','0','0'); -- id=4376
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 4376;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1378, '2026-10-20', 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '411', userid = '2', storedetaildate = '2026-10-20 10:24:13' WHERE storedetailid = '1378';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1378', '1', '6', '1', '1096', 'اضافة فاتورة مبيعات', 'sellbillController.php', '417', '411', '2', '2026-10-20 10:24:13','0','0'); -- id=15183
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6787148.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6784988.5','2160', '0', '2', 'اضافة فاتورة مبيعات', '1096', '6787148.5', '2026-10-20 10:24:13', '2',  'sellbillController.php','1','','0'); -- id=1355
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2160', '2160', '2026-10-20', '2', '0', '0', '2026-10-20 10:24:13','اضافة فاتورة مبيعات رقم 1096','1','0',null,'0','1096','sellbillController.php?do=showDetail&sellbillid=1096'); -- id=3913
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3913', '419', '2160', '','0'); -- id=4016
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6787148', 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 ('3913', '143', '2160', '','0'); -- id=3915
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12420485', 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 ( '1920', '1920', '2026-10-20', '2', '0', '0', '2026-10-20 10:24:13','اضافة فاتورة مبيعات رقم 1096 - صرف البضاعة من المخزن','1','0',null,'0','1096','sellbillController.php?do=showDetail&sellbillid=1096'); -- id=3914
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3914', '402', '1920', '','0'); -- id=4017
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11493566.21', 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 ('3914', '382', '1920', '','0'); -- id=3916
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24014906.99', 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='3913,0,3914' where sellbillid=1096;
 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-20', 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1920, 1920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2160, sellCostBuyPrice =sellCostBuyPrice+1920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1920
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 2160, 1920, 1920
                    , 1920, 1920, 1920, 1920, 1920, 1920)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2160, netSellCostBuyPrice = netSellCostBuyPrice+1920
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1920
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1920
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1920
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1920
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1920
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1920
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1920;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7131de4266 and sellbillId = 1096 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:54:14";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:24:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:24:14', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15095
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', '5', '2026-10-20 10:24:28', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=197
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 ('197', '0', '', '0', 'إضافة مورد جديد', '197', '', '2026-10-20 10:24:28', '5', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=742
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', '', '5', '0', '2026-10-20 10:24:28'); -- id=684
UPDATE supplier SET suppliername = 'مستر ام ', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '5', supplierdate = '2026-10-20', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='684',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '197';
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:55:33";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:25:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 10:25:33', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15096
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-20 06:55:33";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 10:25:33', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15097
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:55:48";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:25:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:25:48', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15098
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:56:22";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:26:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:26:22', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15099
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:56:25";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:26:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:26:25', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15100
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:56:34";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:26:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:26:34', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15101
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:57:09";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:27:09", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:27:09', '5', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15102
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 ('06ad71711ed253', '2026-10-20 10:24:01', '197', '0.00', '73250', '0', '0', '73250.00',  '73250.00', '0', '73250', '1', '2026-10-20 10:27:09', '', '5', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=261
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 ('02258', '261', '199', '2258', '40', '400', '16000.00', '0', '', '2026-10-20 10:27:09', '2258','','','0','0','0','0','0',null,'400','16000','0','0','0','0','0','0','0','0','1'); -- id=1473
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:24:01', 1, 2258, 0, 0
                    , 400, 40, 0, 0, 5, '2026-10-20 10:27:09')
                ON DUPLICATE KEY UPDATE buyprice = 400,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:27:09' ; -- id=6721
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2258', '400', '40', '0', 'buyBillController.php', '1473', '', '0', '0'); -- id=1086
UPDATE product SET  productBuyPrice = "400" WHERE productId = 2258 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1473 ;
UPDATE product SET productName = 'جلد شبابي مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '400.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02258',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '400',meanbuyprice = '400',meanbuyprice_withDiscount = '400' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='400',meanbuyprice_withTax='400',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='400',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2258';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 400, meanbuyprice_withDiscount = 400
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 400, lastbuyprice_withDiscountAndTax = 400
                where buybilldetailid = 1473;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 2258;
UPDATE storedetail SET  productquantity = '40', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3649';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2258', '1', '40', '0', '261', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '5', '2026-10-20 10:24:01','0','0'); -- id=15184
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 ('02259', '261', '199', '2259', '30', '420', '12600.00', '0', '', '2026-10-20 10:27:09', '2259','','','0','0','0','0','0',null,'420','12600','0','0','0','0','0','0','0','0','1'); -- id=1474
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:24:01', 1, 2259, 0, 0
                    , 420, 30, 0, 0, 5, '2026-10-20 10:27:09')
                ON DUPLICATE KEY UPDATE buyprice = 420,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:27:09' ; -- id=6722
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2259', '420', '30', '0', 'buyBillController.php', '1474', '', '0', '0'); -- id=1087
UPDATE product SET  productBuyPrice = "420" WHERE productId = 2259 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1474 ;
UPDATE product SET productName = 'جلد خاص مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '420.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02259',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '420',lastbuyprice_withDiscount = '420',meanbuyprice = '420',meanbuyprice_withDiscount = '420' , productbuypricereal = '420.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.76' , 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 = '2259';
UPDATE buybilldetail SET  lastbuyprice = 420 , meanbuyprice = 420, lastbuyprice_withDiscount = 420, meanbuyprice_withDiscount = 420
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 420
                where buybilldetailid = 1474;
UPDATE productunit SET proUnitBuyPrice  = 420 * productnumber WHERE productid = 2259;
UPDATE storedetail SET  productquantity = '30', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3650';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2259', '1', '30', '0', '261', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '30', '5', '2026-10-20 10:24:01','0','0'); -- id=15185
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 ('02260', '261', '199', '2260', '45', '450', '20250.00', '0', '', '2026-10-20 10:27:09', '2260','','','0','0','0','0','0',null,'450','20250','0','0','0','0','0','0','0','0','1'); -- id=1475
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:24:01', 1, 2260, 0, 0
                    , 450, 45, 0, 0, 5, '2026-10-20 10:27:09')
                ON DUPLICATE KEY UPDATE buyprice = 450,
                        buyQuantity =buyQuantity+45, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:27:09' ; -- id=6723
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2260', '450', '45', '0', 'buyBillController.php', '1475', '', '0', '0'); -- id=1088
UPDATE product SET  productBuyPrice = "450" WHERE productId = 2260 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1475 ;
UPDATE product SET productName = 'بوكس فيت مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '450.00', productSellAllPrice = '465.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02260',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '450.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.33' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='450',meanbuyprice_withTax='450',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='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2260';
UPDATE buybilldetail SET  lastbuyprice = 450 , meanbuyprice = 450, lastbuyprice_withDiscount = 450, meanbuyprice_withDiscount = 450
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where buybilldetailid = 1475;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 2260;
UPDATE storedetail SET  productquantity = '45', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2260', '1', '45', '0', '261', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '45', '5', '2026-10-20 10:24:01','0','0'); -- id=15186
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 ('02261', '261', '199', '2261', '40', '610', '24400.00', '0', '', '2026-10-20 10:27:09', '2261','','','0','0','0','0','0',null,'610','24400','0','0','0','0','0','0','0','0','1'); -- id=1476
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:24:01', 1, 2261, 0, 0
                    , 610, 40, 0, 0, 5, '2026-10-20 10:27:09')
                ON DUPLICATE KEY UPDATE buyprice = 610,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:27:09' ; -- id=6724
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2261', '610', '40', '0', 'buyBillController.php', '1476', '', '0', '0'); -- id=1089
UPDATE product SET  productBuyPrice = "610" WHERE productId = 2261 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1476 ;
UPDATE product SET productName = 'جبردين زنط مستر ام ', productDescription = '', productCatId = '199', productBuyPrice = '610.00', productSellAllPrice = '635.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02261',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '610',lastbuyprice_withDiscount = '610',meanbuyprice = '610',meanbuyprice_withDiscount = '610' , productbuypricereal = '610.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.10' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='610',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='610',meanbuyprice_withTax='610',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='610',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2261';
UPDATE buybilldetail SET  lastbuyprice = 610 , meanbuyprice = 610, lastbuyprice_withDiscount = 610, meanbuyprice_withDiscount = 610
        , lastbuyprice_withTax = 610, meanbuyprice_withTax = 610, lastbuyprice_withDiscountAndTax = 610
                where buybilldetailid = 1476;
UPDATE productunit SET proUnitBuyPrice  = 610 * productnumber WHERE productid = 2261;
UPDATE storedetail SET  productquantity = '40', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3652';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2261', '1', '40', '0', '261', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '5', '2026-10-20 10:24:01','0','0'); -- id=15187
UPDATE supplier SET  suppliercurrentDebt = '73250',suppliercurrentDebtInCurrency= '73250' , userid = '5', supplierdate = '2026-10-20 10:27:09'   WHERE supplierid = '197';
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 ('197', '0.00', '73250', '0', 'اضافة فاتورة مشتريات', '261', '73250', '2026-10-20 10:24:01', '5', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','73250','1','0','73250','73250','0',''); -- id=743
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '73250', '73250', '2026-10-20', '5', '0', '0', '2026-10-20 10:27:09','اضافة فاتورة مشتريات رقم 261','1','0',null,'0','261','buyBillController.php?do=details&id=261'); -- id=3915
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3915', '382', '73250', '','0'); -- id=4018
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24088156.99', 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 ('3915', '684', '73250', '','0'); -- id=3917
UPDATE accountstree SET name = 'مستر ام ', customName = 'مستر ام ', customNameEn = 'مستر ام ', nameEn = 'مستر ام ', parent = '81', accountNature = '1', theValue = '73250', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '5', del = '0', sysdate = '2026-10-20 10:24:28' WHERE id = '684';
update buybill set dailyentryid='3915,0' where buybillid=261;
COMMIT;
UPDATE product SET overAllAveragePrice = 400 WHERE productId = 2258;UPDATE product SET overAllAveragePrice = 420 WHERE productId = 2259;UPDATE product SET overAllAveragePrice = 450 WHERE productId = 2260;UPDATE product SET overAllAveragePrice = 610 WHERE productId = 2261;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:57:09";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:27:09", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:27:09', '5', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=261'); -- id=15103
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:57:12";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:27:12", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:27:12', '5', 'showbarcodebuybill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=261&type=2'); -- id=15104
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:57:30";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:27:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:27:30', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15105
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:57:32";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:27:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:27:32', '1', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15106
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:58:09";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:28:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:28:09', '1', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15107
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:59:50";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:29:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:29:50', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15108
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 06:59:54";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:29:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:29:54', '1', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15109
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:00:04";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:30:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreport.php', '2026-10-20 10:30:04', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreport.php'); -- id=15110
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:00:16";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:30:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('profitreportController.php', '2026-10-20 10:30:16', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/profitreportController.php'); -- id=15111
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:00:22";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:30:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 10:30:22', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15112
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:00:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:30:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 10:30:28', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15113
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:00:51";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:30:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:30:51', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15114
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:00:54";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:30:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:30:54', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15115
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:01:11";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:31:11", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:31:11', '5', 'showbarcodebuybill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=261&type=2'); -- id=15116
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:01:12";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:31:12", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:31:12', '5', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=261'); -- id=15117
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:01:13";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:31:13", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:31:13', '5', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15118
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:01:13";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:31:13", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:31:13', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15119
UPDATE productunit SET proUnitSellAllPrice  = 480.00 * productnumber  WHERE productid = 2132;
UPDATE product SET productName = 'تطريز جبردين بلاك اند وايت ', productDescription = '', productCatId = '183', productBuyPrice = '440.00', productSellAllPrice = '480.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02132',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440.00',lastbuyprice_withDiscount = '440',meanbuyprice = '440.00',meanbuyprice_withDiscount = '440' , productbuypricereal = '440.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='217.68',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='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 = '2132';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2132, 1,'2026-10-20 10:31:26',1)
                ON DUPLICATE KEY UPDATE productid = 2132, edited = 1, sysdate = '2026-10-20 10:31:26', userid = 1; -- id=3106
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:01:57";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:31:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:31:57', '1', 'edit', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=edit&id=2132'); -- id=15120
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:02:50";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:32:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:32:50', '1', 'update', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=update'); -- id=15121
BEGIN;
UPDATE product SET productName = 'تطريز جبردين بلاك اند وايت ', productDescription = '', productCatId = '183', productBuyPrice = '440', productSellAllPrice = '480', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02132',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '480',lastbuyprice_withDiscount = '480',meanbuyprice = '440.00',meanbuyprice_withDiscount = '440' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='480',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='480',meanbuyprice_withTax='217.68',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='480',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2132';
UPDATE product SET treeId = 0 WHERE productId = 2132;
UPDATE productunit SET  conditions = 1 WHERE productunitid = 2132;
UPDATE productunit SET unitid = '1', productid = '2132', productnumber = '1.00', productunitdate = '2026-10-20', userid = '1', conditions = '0',proUnitParcode='0213201',proUnitSellAllPrice='480',proUnitSellHalfPrice='0',proUnitSellUnitPrice ='0',proUnitBuyPrice='440',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '2132';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2132, 1,'2026-10-20 10:32:50',1)
                ON DUPLICATE KEY UPDATE productid = 2132, edited = 1, sysdate = '2026-10-20 10:32:50', userid = 1; -- id=3106
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:02:51";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:32:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:32:51', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15122
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:02:58";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:32:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:32:58', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15123
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:03:03";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:33:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:33:03', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15124
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:03:24";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:33:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:33:24', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15125
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:03:31";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:33:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:33:31', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15126
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:03:59";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:33:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:33:59', '1', 'edit', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=edit&id=1919'); -- id=15127
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:04:07";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:34:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:34:07', '1', 'update', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=update'); -- id=15128
BEGIN;
UPDATE product SET productName = 'سويت شيرت 450 مصطفي زورو', productDescription = '', productCatId = '153', productBuyPrice = '425', productSellAllPrice = '450', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01919',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '425.00',lastbuyprice_withDiscount = '425',meanbuyprice = '425.00',meanbuyprice_withDiscount = '425' , productbuypricereal = '0' , buypricereal_precentage = '0' , buytotal_precentage = '5.88' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='425',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='425',meanbuyprice_withTax='425',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='425',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1919';
UPDATE product SET treeId = 0 WHERE productId = 1919;
UPDATE productunit SET  conditions = 1 WHERE productunitid = 1919;
UPDATE productunit SET unitid = '1', productid = '1919', productnumber = '1.00', productunitdate = '2026-10-20', userid = '1', conditions = '0',proUnitParcode='0191901',proUnitSellAllPrice='450',proUnitSellHalfPrice='0',proUnitSellUnitPrice ='0',proUnitBuyPrice='425',unitInTax='',proUnitPrice4='0',proUnitPrice5='0',proUnitPrice6='0',proUnitPrice7='0',proUnitPrice8='0',proUnitPrice9='0',proUnitPrice10='0',proUnitPrice11='0',proUnitPrice12='0',proUnitPrice13='0' WHERE productunitid = '1919';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1919, 1,'2026-10-20 10:34:07',1)
                ON DUPLICATE KEY UPDATE productid = 1919, edited = 1, sysdate = '2026-10-20 10:34:07', userid = 1; -- id=2853
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:04:09";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:34:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:34:09', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15129
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:04:14";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:34:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:34:14', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15130
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:04:31";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:34:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productmovmentController.php', '2026-10-20 10:34:31', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productmovmentController.php'); -- id=15131
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:04:36";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:34:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productmovmentController.php', '2026-10-20 10:34:36', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productmovmentController.php?do=show'); -- id=15132
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:06:19";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:36:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 10:36:19', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15133
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-20 07:06:19";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 10:36:19", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 10:36:19', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15134
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:06:23";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:36:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('salesreportbills.php', '2026-10-20 10:36:23', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/salesreportbills.php'); -- id=15135
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:07:23";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:37:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:37:23', '1', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15136
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:09:02";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:39:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 10:39:02', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15137
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-20 07:09:02";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 10:39:02", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 10:39:02', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15138
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:09:07";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:39:07", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:39:07', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15139

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7171e15acb
-- ----------------------------------------------------------------------------------------------------

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-20 10:39:07', '06ad7171e15acb', '1', '0.00', '0', '0', '1', '25440.00', '25440', '25440', '0', '1', '2026-10-20 10:39:07', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '75' ,'0','','','','','-1','0','0','0','0','0','25440','0','','0','0','25440','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1097
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','اضافة فاتورة مبيعات','1097', '0', '2026-10-20 10:39:07', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '25440', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 10:39:07','0','0','',''); -- id=1312
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6546;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('312.8','02234', '1097', '195', '2234', '9', '340', '3060', '0', '', '0', '2026-10-20 10:39:07', '2234', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6546-9,','1','1','0','0','340','3060','0','','0','0.00','0','0','0','0'); -- id=4377
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 312.80, meanbuyprice_withDiscount = 312.80
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 312.8
                where sellbilldetailid = 4377;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2234, '2026-10-20', 3060, 3060, 3060
                    , 3060, 2815.2, 2815.2, 2815.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3060, 3060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3060, sellCostBuyPrice =sellCostBuyPrice+3060
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3060, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3060
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2815.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2815.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2815.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3060
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3060
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 3060, 3060, 3060
                    , 3060, 2815.2, 2815.2, 2815.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3060, 3060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3060, sellCostBuyPrice =sellCostBuyPrice+3060
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3060, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3060
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2815.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2815.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2815.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3060
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3060
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '57', userid = '2', storedetaildate = '2026-10-20 10:39:07' WHERE storedetailid = '3625';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2234', '1', '9', '1', '1097', 'اضافة فاتورة مبيعات', 'sellbillController.php', '66', '57', '2', '2026-10-20 10:39:07','0','0'); -- id=15188
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6646;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02243', '1097', '72', '2243', '6', '350', '2100', '0', '', '0', '2026-10-20 10:39:07', '2243', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6646-6,','1','1','0','0','350','2100','0','','0','0.00','0','0','0','0'); -- id=4378
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 4378;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2243, '2026-10-20', 2100, 2100, 2100
                    , 2100, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2100, 2100, 2100
                    , 2100, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '39', userid = '2', storedetaildate = '2026-10-20 10:39:07' WHERE storedetailid = '3634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2243', '1', '6', '1', '1097', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '39', '2', '2026-10-20 10:39:07','0','0'); -- id=15189
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6543;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('303.6','02231', '1097', '195', '2231', '9', '330', '2970', '0', '', '0', '2026-10-20 10:39:07', '2231', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6543-9,','1','1','0','0','330','2970','0','','0','0.00','0','0','0','0'); -- id=4379
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 303.60, meanbuyprice_withDiscount = 316.80
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 303.6
                where sellbilldetailid = 4379;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2231, '2026-10-20', 2970, 2970, 2970
                    , 2970, 2732.4, 2851.2, 2732.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2970, 1485, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2970, sellCostBuyPrice =sellCostBuyPrice+2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2732.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2851.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2732.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1485
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2970, 2970, 2970
                    , 2970, 2732.4, 2851.2, 2732.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2970, 1485, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2970, sellCostBuyPrice =sellCostBuyPrice+2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2732.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2851.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2732.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1485
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 10:39:07' WHERE storedetailid = '3622';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2231', '1', '9', '1', '1097', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '24', '2', '2026-10-20 10:39:07','0','0'); -- id=15190
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','09681', '1097', '68', '1240', '12', '245', '2940', '0', '', '0', '2026-10-20 10:39:07', '1240', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','245','2940','0','','0','0.00','0','0','0','0'); -- id=4380
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 4380;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1240, '2026-10-20', 2940, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2940, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2940, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2940, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-20 10:39:07' WHERE storedetailid = '1240';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1240', '1', '12', '1', '1097', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '36', '2', '2026-10-20 10:39:07','0','0'); -- id=15191
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 1170;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','01976', '1097', '59', '1976', '6', '320', '1920', '0', '', '0', '2026-10-20 10:39:07', '1976', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1170-6,','1','1','0','0','320','1920','0','','0','0.00','0','0','0','0'); -- id=4381
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 4381;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1976, '2026-10-20', 1920, 1860, 1860
                    , 1860, 1860, 1860, 1860
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1860, 1860, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1920, sellCostBuyPrice =sellCostBuyPrice+1860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1860, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1860
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1860, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1860
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1860
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1860
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1860
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1920, 1860, 1860
                    , 1860, 1860, 1860, 1860
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1860, 1860, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1920, sellCostBuyPrice =sellCostBuyPrice+1860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1860, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1860
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1860, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1860
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1860
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1860
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1860
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '57', userid = '2', storedetaildate = '2026-10-20 10:39:07' WHERE storedetailid = '2993';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1976', '1', '6', '1', '1097', 'اضافة فاتورة مبيعات', 'sellbillController.php', '63', '57', '2', '2026-10-20 10:39:07','0','0'); -- id=15192
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6125;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('297','02080', '1097', '43', '2080', '6', '330', '1980', '0', '', '0', '2026-10-20 10:39:07', '2080', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6125-6,','1','1','0','0','330','1980','0','','0','0.00','0','0','0','0'); -- id=4382
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 297.00, meanbuyprice_withDiscount = 297.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 297
                where sellbilldetailid = 4382;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2080, '2026-10-20', 1980, 1980, 1980
                    , 1980, 1782, 1782, 1782
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1980, 1980, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1980
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1980, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1980
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1782, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1782
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1782
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1980
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1980, 1980, 1980
                    , 1980, 1782, 1782, 1782
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1980, 1980, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1980
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1980, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1980
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1782, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1782
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1782
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1980
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '2', storedetaildate = '2026-10-20 10:39:07' WHERE storedetailid = '3439';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2080', '1', '6', '1', '1097', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '27', '2', '2026-10-20 10:39:07','0','0'); -- id=15193
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6517;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('333','02207', '1097', '48', '2207', '6', '370', '2220', '0', '', '0', '2026-10-20 10:39:07', '2207', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6517-6,','1','1','0','0','370','2220','0','','0','0.00','0','0','0','0'); -- id=4383
UPDATE sellbilldetail SET  lastbuyprice = 370.00 , meanbuyprice = 370.00, lastbuyprice_withDiscount = 333.00, meanbuyprice_withDiscount = 333.00
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 333
                where sellbilldetailid = 4383;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2207, '2026-10-20', 2220, 2220, 2220
                    , 2220, 1998, 1998, 1998
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2220, sellCostBuyPrice =sellCostBuyPrice+2220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1998, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1998
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1998
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2220, 2220, 2220
                    , 2220, 1998, 1998, 1998
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2220, sellCostBuyPrice =sellCostBuyPrice+2220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1998, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1998
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1998
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 10:39:07' WHERE storedetailid = '3598';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2207', '1', '6', '1', '1097', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '15', '2', '2026-10-20 10:39:07','0','0'); -- id=15194
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6516;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02206', '1097', '48', '2206', '9', '350', '3150', '0', '', '0', '2026-10-20 10:39:07', '2206', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6516-9,','1','1','0','0','350','3150','0','','0','0.00','0','0','0','0'); -- id=4384
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 4384;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2206, '2026-10-20', 3150, 3150, 3150
                    , 3150, 2835, 2835, 2835
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3150, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2835, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2835
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2835
                            , 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 (1, '2026-10-20', 3150, 3150, 3150
                    , 3150, 2835, 2835, 2835
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3150, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2835, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2835
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2835
                            , 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 = '12', userid = '2', storedetaildate = '2026-10-20 10:39:07' WHERE storedetailid = '3597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2206', '1', '9', '1', '1097', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '12', '2', '2026-10-20 10:39:07','0','0'); -- id=15195
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6080;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','i0002048', '1097', '42', '2048', '12', '425', '5100', '0', '', '0', '2026-10-20 10:39:07', '2048', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6080-12,','1','1','0','0','425','5100','0','','0','0.00','0','0','0','0'); -- id=4385
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 = 4385;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2048, '2026-10-20', 5100, 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+5100, 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 (1, '2026-10-20', 5100, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5100, 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 = '15', userid = '2', storedetaildate = '2026-10-20 10:39:07' WHERE storedetailid = '3407';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2048', '1', '12', '1', '1097', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '15', '2', '2026-10-20 10:39:07','0','0'); -- id=15196
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6812588.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6787148.5','25440', '0', '2', 'اضافة فاتورة مبيعات', '1097', '6812588.5', '2026-10-20 10:39:07', '2',  'sellbillController.php','1','','0'); -- id=1356
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '25440', '25440', '2026-10-20', '2', '0', '0', '2026-10-20 10:39:07','اضافة فاتورة مبيعات رقم 1097','1','0',null,'0','1097','sellbillController.php?do=showDetail&sellbillid=1097'); -- id=3916
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3916', '419', '25440', '','0'); -- id=4019
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6812588', 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 ('3916', '143', '25440', '','0'); -- id=3918
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12445925', 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 ( '23532.6', '23532.6', '2026-10-20', '2', '0', '0', '2026-10-20 10:39:07','اضافة فاتورة مبيعات رقم 1097 - صرف البضاعة من المخزن','1','0',null,'0','1097','sellbillController.php?do=showDetail&sellbillid=1097'); -- id=3917
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3917', '402', '23532.6', '','0'); -- id=4020
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11517098.81', 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 ('3917', '382', '23532.6', '','0'); -- id=3919
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24064624.39', 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='3916,0,3917' where sellbillid=1097;
 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-20', 25440, 24960, 24960
                    , 24960, 23532.6, 23651.4, 23532.6
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,24960, 23475, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+25440, sellCostBuyPrice =sellCostBuyPrice+24960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+24960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+24960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+23532.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+23651.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+23532.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+24960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+23475
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 25440, 24960, 24960
                    , 24960, 23532.6, 23651.4, 23532.6
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,24960, 23475, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+25440, sellCostBuyPrice =sellCostBuyPrice+24960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+24960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+24960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+23532.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+23651.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+23532.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+24960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+23475
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 25440, 24960, 24960
                    , 24960, 23532.6, 23651.4, 23532.6, 24960, 23475)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+25440, netSellCostBuyPrice = netSellCostBuyPrice+24960
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+24960
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+24960
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+23532.6
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+23651.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+23532.6
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+24960
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+23475;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7171e15acb and sellbillId = 1097 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:09:08";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:39:08", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:39:08', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15140
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:11:03";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:41:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:41:03', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15141
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:11:08";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:41:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:41:08', '1', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15142
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:11:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:41:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:41:28', '1', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15143
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:11:49";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:41:49", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:41:49', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=15144
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:11:57";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:41:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:41:57', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15145
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:12:26";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:42:26", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:42:26', '5', 'add2', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=15146
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('ابراهيم الجمل ','2026-10-20','','41', '5','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=200
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (200, 1,'2026-10-20 10:42:26',5)
                ON DUPLICATE KEY UPDATE catid = 200, edited = 1, sysdate = '2026-10-20 10:42:26', userid = 5; -- id=215
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:12:27";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:42:27", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:42:27', '5', 'sucess', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=15147
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:12:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:42:28", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 10:42:28', '5', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=15148
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:12:31";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:42:31", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:42:31', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15149
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:12:56";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:42:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:42:56', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15150
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:13:03";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:43:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:43:03', '1', 'editbill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=259'); -- id=15151
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:13:22";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:43:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:43:22', '1', 'update', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=15152
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 259;
UPDATE buybill SET  buybillsysdate = '2026-10-20 10:43:22', userid = '7',delbyuserid = '1', conditions = '1' WHERE buybillid = '259';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 1, 1443, 0, 0
                    , 380, 32, 0, 0, 1, '2026-10-20 10:43:22')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-32, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:22' ; -- id=6714
UPDATE product SET productName = 'حوض origian سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '380.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01443',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 = '7.89' , 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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1443';
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 1443;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1456';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1443', '1', '32', '1', '259', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '32', '0', '1', '2026-10-20 10:13:41','0','0'); -- id=15197
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 1, 1442, 0, 0
                    , 410, 24, 0, 0, 1, '2026-10-20 10:43:22')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:22' ; -- id=6715
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1442';
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1442;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1455';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '1', '24', '1', '259', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '84', '60', '1', '2026-10-20 10:13:41','0','0'); -- id=15198
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 1, 1442, 0, 0
                    , 410, 36, 0, 0, 1, '2026-10-20 10:43:22')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-36, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:22' ; -- id=6715
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1442';
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1442;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1455';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '1', '36', '1', '259', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '60', '24', '1', '2026-10-20 10:13:41','0','0'); -- id=15199
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 1, 1442, 0, 0
                    , 410, 24, 0, 0, 1, '2026-10-20 10:43:22')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:22' ; -- id=6715
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1442';
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1442;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1455';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '1', '24', '1', '259', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-20 10:13:41','0','0'); -- id=15200
UPDATE supplier SET  suppliercurrentDebt = '-112910',suppliercurrentDebtInCurrency= '-112910' , userid = '1', supplierdate = '2026-10-20 10:43:22'   WHERE supplierid = '75';
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 ('75', '-66310.00', '46600.00', '1', 'حذف فاتورة مشتريات - للتعديل', '259', '-112910', '2026-10-20 10:13:41', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','46600','1','-66310','46600','-112910','0',''); -- id=744
UPDATE productserial SET del = 1
		 WHERE billid = 259;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06ad714a513fa6', '2026-10-20 10:13:41', '75', '-112910.00', '-66310', '0', '0', '46600.00', '46600.00', '0.00', '46600', '2', '2026-10-20 10:43:22', '', '1', '0', '', '1', '1','1','259','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=262
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 ('01443', '262', '88', '1443', '32.00', '380', '12160.00', '0.00', '', '2026-10-20 10:43:22', '1443','','','0','0','0','0','0',null,'380','12160','0','0','0','0','0','0','0','0','2'); -- id=1477
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 2, 1443, 0, 0
                    , 380, 32, 0, 0, 1, '2026-10-20 10:43:22')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+32, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:22' ; -- id=6729
UPDATE product SET  productBuyPrice = "380" WHERE productId = 1443 ;
UPDATE buybilldetail SET  quantitybefore = 3 WHERE buybilldetailid = 1477 ;
UPDATE product SET productName = 'حوض origian سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '380.00', productSellAllPrice = '410.00', productSellUnitPrice = '410.00', productSellHalfPrice = '410.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01443',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 = '7.89' , 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 = '1443';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 1477;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 1443;
UPDATE storedetail SET  productquantity = '35', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1443', '2', '32', '0', '262', 'اضافة فاتورة مشتريات', 'buyBillController.php', '3', '35', '1', '2026-10-20 10:13:41','0','0'); -- id=15201
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 ('01442', '262', '88', '1442', '24.00', '410', '9840.00', '0.00', '', '2026-10-20 10:43:22', '1442','','','0','0','0','0','0',null,'410','9840','0','0','0','0','0','0','0','0','2'); -- id=1478
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 2, 1442, 0, 0
                    , 410, 24, 0, 0, 1, '2026-10-20 10:43:22')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:22' ; -- id=6730
UPDATE product SET  productBuyPrice = "410" WHERE productId = 1442 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1478 ;
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',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 = '1442';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 1478;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1442;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1473';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '2', '24', '0', '262', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-20 10:13:41','0','0'); -- id=15202
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 ('01442', '262', '88', '1442', '36.00', '410', '14760.00', '0.00', '', '2026-10-20 10:43:22', '1442','','','0','0','0','0','0',null,'410','14760','0','0','0','0','0','0','0','0','2'); -- id=1479
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 2, 1442, 0, 0
                    , 410, 36, 0, 0, 1, '2026-10-20 10:43:22')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:22' ; -- id=6730
UPDATE product SET  productBuyPrice = "410" WHERE productId = 1442 ;
UPDATE buybilldetail SET  quantitybefore = 24 WHERE buybilldetailid = 1479 ;
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',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 = '1442';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 1479;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1442;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1473';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '2', '36', '0', '262', 'اضافة فاتورة مشتريات', 'buyBillController.php', '24', '60', '1', '2026-10-20 10:13:41','0','0'); -- id=15203
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 ('01442', '262', '88', '1442', '24.00', '410', '9840.00', '0.00', '', '2026-10-20 10:43:22', '1442','','','0','0','0','0','0',null,'410','9840','0','0','0','0','0','0','0','0','2'); -- id=1480
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:13:41', 2, 1442, 0, 0
                    , 410, 24, 0, 0, 1, '2026-10-20 10:43:22')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:22' ; -- id=6730
UPDATE product SET  productBuyPrice = "410" WHERE productId = 1442 ;
UPDATE buybilldetail SET  quantitybefore = 60 WHERE buybilldetailid = 1480 ;
UPDATE product SET productName = 'موديلات 440 سفنتي', productDescription = '', productCatId = '88', productBuyPrice = '410.00', productSellAllPrice = '440.00', productSellUnitPrice = '440.00', productSellHalfPrice = '440.00', productDate = '2026-10-05', conditions = '0', userId = '1', limitamount = '0', parcode = '01442',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.32' , 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='1',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 = '1442';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 1480;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1442;
UPDATE storedetail SET  productquantity = '84', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1473';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '2', '24', '0', '262', 'اضافة فاتورة مشتريات', 'buyBillController.php', '60', '84', '1', '2026-10-20 10:13:41','0','0'); -- id=15204
DELETE FROM productserial WHERE billid = 259
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '-66310',suppliercurrentDebtInCurrency= '-66310' , userid = '1', supplierdate = '2026-10-20 10:43:22'   WHERE supplierid = '75';
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 ('75', '-112910.00', '46600', '0', 'اضافة فاتورة مشتريات', '262', '-66310', '2026-10-20 10:43:22', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','46600','1','-112910','46600','-66310','0',''); -- id=745
UPDATE dailyentry SET totalcreditor = '46600.00', totaldebtor = '46600.00', thedate = '2026-10-20', userid = '7', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-20 10:15:19', entryComment = 'اضافة فاتورة مشتريات رقم 259', fromFlag = '1',related='0',isopeningentry='0',operationId='259',operationDetailLink='buyBillController.php?do=details&id=259' WHERE id = '3911';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '46600.00', '46600.00', '2026-10-20', '1', '0', '3911', '2026-10-20 10:43:22','تم عكس القيد رقم 3911 ','1','0','0','0','0',''); -- id=3918
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3918', '382', '46600.00', '','0'); -- id=3920
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24018024.39', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3918', '499', '46600.00', '','0'); -- id=4021
UPDATE accountstree SET name = 'سفنتي', customName = 'سفنتي', customNameEn = 'سفنتي', nameEn = 'سفنتي', parent = '81', accountNature = '1', theValue = '-112910', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 16:43:09' WHERE id = '499';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '46600', '46600', '2026-10-20', '1', '0', '0', '2026-10-20 10:43:22','اضافة فاتورة مشتريات رقم 262','1','0',null,'0','262','buyBillController.php?do=details&id=262'); -- id=3919
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3919', '492', '46600', '','0'); -- id=4022
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1623875.5', 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 ('3919', '499', '46600', '','0'); -- id=3921
UPDATE accountstree SET name = 'سفنتي', customName = 'سفنتي', customNameEn = 'سفنتي', nameEn = 'سفنتي', parent = '81', accountNature = '1', theValue = '-66310', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-09-30 16:43:09' WHERE id = '499';
update buybill set dailyentryid='3919,0' where buybillid=262;
UPDATE product SET overAllAveragePrice = 410 WHERE productId = 1442;UPDATE product SET overAllAveragePrice = 380 WHERE productId = 1443;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:13:23";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:43:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:43:23', '1', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=262'); -- id=15153
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:13:30";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:43:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:43:30', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15154
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:13:33";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:43:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:43:33', '1', 'editbill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=258'); -- id=15155
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:13:38";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:43:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:43:38', '1', 'update', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=15156
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 258;
UPDATE buybill SET  buybillsysdate = '2026-10-20 10:43:38', userid = '5',delbyuserid = '1', conditions = '1' WHERE buybillid = '258';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:03:59', 1, 2253, 0, 0
                    , 400, 72, 0, 0, 1, '2026-10-20 10:43:38')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-72, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:38' ; -- id=6712
UPDATE buybilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 400.00, meanbuyprice_withTax = 400.00, lastbuyprice_withDiscountAndTax = 360.00
                where buybilldetailid = 1464;
UPDATE product SET productName = 'روند ارمي النوبي ', productDescription = '', productCatId = '197', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02253',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '0',meanbuyprice = '400.00',meanbuyprice_withDiscount = '400' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',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='400',meanbuyprice_withTax='0',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2253';
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 2253;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3644';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2253', '1', '72', '1', '258', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '72', '0', '1', '2026-10-20 10:03:59','0','0'); -- id=15205
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:03:59', 1, 2254, 0, 0
                    , 585, 48, 0, 0, 1, '2026-10-20 10:43:38')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-48, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:38' ; -- id=6713
UPDATE buybilldetail SET  lastbuyprice = 585.00 , meanbuyprice = 585.00, lastbuyprice_withDiscount = 526.50, meanbuyprice_withDiscount = 526.50
        , lastbuyprice_withTax = 585.00, meanbuyprice_withTax = 585.00, lastbuyprice_withDiscountAndTax = 526.50
                where buybilldetailid = 1465;
UPDATE product SET productName = 'سوسته ارمي النوبي ', productDescription = '', productCatId = '197', productBuyPrice = '585.00', productSellAllPrice = '585.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02254',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '585',lastbuyprice_withDiscount = '0',meanbuyprice = '585.00',meanbuyprice_withDiscount = '585' , productbuypricereal = '585.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='526.5',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='585',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2254';
UPDATE productunit SET proUnitBuyPrice  = 585 * productnumber WHERE productid = 2254;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3645';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2254', '1', '48', '1', '258', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '48', '0', '1', '2026-10-20 10:03:59','0','0'); -- id=15206
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-10-20 10:43:38'   WHERE supplierid = '195';
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 ('195', '51192.00', '51192.00', '1', 'حذف فاتورة مشتريات - للتعديل', '258', '0', '2026-10-20 10:03:59', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','51192','1','51192','51192','0','0',''); -- id=746
UPDATE productserial SET del = 1
		 WHERE billid = 258;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06ad7125f1d799', '2026-10-20 10:03:59', '195', '0.00', '51192', '10', '1', '56880.00', '51192.00', '0.00', '51192', '2', '2026-10-20 10:43:38', '', '1', '0', '', '1', '1','1','258','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=263
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 ('02253', '263', '197', '2253', '72.00', '400', '28800.00', '0.00', '', '2026-10-20 10:43:38', '2253','','','0','0','0','0','0',null,'400','28800','0','0','0','0','0','0','0','0','2'); -- id=1481
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:03:59', 2, 2253, 0, 0
                    , 360, 72, 0, 0, 1, '2026-10-20 10:43:38')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:38' ; -- id=6735
UPDATE product SET  productBuyPrice = "400" WHERE productId = 2253 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1481 ;
UPDATE product SET productName = 'روند ارمي النوبي ', productDescription = '', productCatId = '197', productBuyPrice = '400.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02253',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '400',lastbuyprice_withDiscount = '360',meanbuyprice = '400',meanbuyprice_withDiscount = '380' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',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='400',meanbuyprice_withTax='200',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2253';
UPDATE buybilldetail SET  lastbuyprice = 400 , meanbuyprice = 400, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 1481;
UPDATE productunit SET proUnitBuyPrice  = 400 * productnumber WHERE productid = 2253;
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2253', '2', '72', '1', '2026-10-20 10:03:59'); -- id=3653
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2253', '2', '72', '0', '263', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '72', '1', '2026-10-20 10:03:59','0','0'); -- id=15207
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 ('02254', '263', '197', '2254', '48.00', '585', '28080.00', '0.00', '', '2026-10-20 10:43:38', '2254','','','0','0','0','0','0',null,'585','28080','0','0','0','0','0','0','0','0','2'); -- id=1482
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:03:59', 2, 2254, 0, 0
                    , 526.5, 48, 0, 0, 1, '2026-10-20 10:43:38')
                ON DUPLICATE KEY UPDATE buyprice = 526.5,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 10:43:38' ; -- id=6736
UPDATE product SET  productBuyPrice = "585" WHERE productId = 2254 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1482 ;
UPDATE product SET productName = 'سوسته ارمي النوبي ', productDescription = '', productCatId = '197', productBuyPrice = '585.00', productSellAllPrice = '585.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02254',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '585',lastbuyprice_withDiscount = '526.5',meanbuyprice = '585',meanbuyprice_withDiscount = '555.75' , productbuypricereal = '585.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='526.5',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='585',meanbuyprice_withTax='292.5',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='526.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2254';
UPDATE buybilldetail SET  lastbuyprice = 585 , meanbuyprice = 585, lastbuyprice_withDiscount = 526.5, meanbuyprice_withDiscount = 555.75
        , lastbuyprice_withTax = 585, meanbuyprice_withTax = 292.5, lastbuyprice_withDiscountAndTax = 526.5
                where buybilldetailid = 1482;
UPDATE productunit SET proUnitBuyPrice  = 585 * productnumber WHERE productid = 2254;
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2254', '2', '48', '1', '2026-10-20 10:03:59'); -- id=3654
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2254', '2', '48', '0', '263', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '48', '1', '2026-10-20 10:03:59','0','0'); -- id=15208
DELETE FROM productserial WHERE billid = 258
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '51192',suppliercurrentDebtInCurrency= '51192' , userid = '1', supplierdate = '2026-10-20 10:43:38'   WHERE supplierid = '195';
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 ('195', '0.00', '51192', '0', 'اضافة فاتورة مشتريات', '263', '51192', '2026-10-20 10:43:38', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','51192','1','0','51192','51192','0',''); -- id=747
UPDATE dailyentry SET totalcreditor = '51192.00', totaldebtor = '51192.00', thedate = '2026-10-20', userid = '5', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-20 10:06:45', entryComment = 'اضافة فاتورة مشتريات رقم 258', fromFlag = '1',related='0',isopeningentry='0',operationId='258',operationDetailLink='buyBillController.php?do=details&id=258' WHERE id = '3906';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '51192.00', '51192.00', '2026-10-20', '1', '0', '3906', '2026-10-20 10:43:38','تم عكس القيد رقم 3906 ','1','0','0','0','0',''); -- id=3920
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3920', '382', '51192.00', '','0'); -- id=3922
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23966832.39', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3920', '682', '51192.00', '','0'); -- id=4023
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 = '5', del = '0', sysdate = '2026-10-20 10:04:33' WHERE id = '682';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '51192', '51192', '2026-10-20', '1', '0', '0', '2026-10-20 10:43:38','اضافة فاتورة مشتريات رقم 263','1','0',null,'0','263','buyBillController.php?do=details&id=263'); -- id=3921
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3921', '492', '51192', '','0'); -- id=4024
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1675067.5', 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 ('3921', '682', '51192', '','0'); -- id=3923
UPDATE accountstree SET name = 'ارمي النوبي', customName = 'ارمي النوبي', customNameEn = 'ارمي النوبي', nameEn = 'ارمي النوبي', parent = '81', accountNature = '1', theValue = '51192', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '5', del = '0', sysdate = '2026-10-20 10:04:33' WHERE id = '682';
update buybill set dailyentryid='3921,0' where buybillid=263;
UPDATE product SET overAllAveragePrice = 360 WHERE productId = 2253;UPDATE product SET overAllAveragePrice = 526.5 WHERE productId = 2254;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:13:38";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:43:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:43:38', '1', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=263'); -- id=15157
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:14:32";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:44:32", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:44:32', '5', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15158
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديل 325 ابراهيم الجمل ','','200','325','325','0','0','2026-10-20','0','5','0','','0','0','0','0','0','325','325','325','325','325','0','0','0','0','.','0','0','0','325','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','325','325','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','325','0','0','0','0','0','0','','','0','0','0','0'); -- id=2262
UPDATE product SET productName = 'موديل 325 ابراهيم الجمل ', productDescription = '', productCatId = '200', productBuyPrice = '325', productSellAllPrice = '325', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02262',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '325',lastbuyprice_withDiscount = '325',meanbuyprice = '325',meanbuyprice_withDiscount = '325' , productbuypricereal = '325' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='325',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='325',meanbuyprice_withTax='325',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='325',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2262';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2262', '1', '2026-10-20', '5', '0','0226201','325','0','0','325','','0','0','0','0','0','0','0','0','0','0'); -- id=2262
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2262', '1', '0', '5', '2026-10-20'); -- id=3655
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2262', '1', '0', '0', '2262', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15209
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2262, 1,'2026-10-20 10:44:32',5)
                ON DUPLICATE KEY UPDATE productid = 2262, edited = 1, sysdate = '2026-10-20 10:44:32', userid = 5; -- id=3308
UPDATE product SET productName = 'موديل 325 ابراهيم الجمل ', productDescription = '', productCatId = '200', productBuyPrice = '325.00', productSellAllPrice = '325.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02262',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '325',lastbuyprice_withDiscount = '325',meanbuyprice = '325',meanbuyprice_withDiscount = '325' , productbuypricereal = '325' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='325',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='325',meanbuyprice_withTax='325',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='325',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2262';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES (' موديل 330 ابراهيم الجمل ','','200','330','330','0','0','2026-10-20','0','5','0','','0','0','0','0','0','330','330','330','330','330','0','0','0','0','.','0','0','0','330','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','330','330','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','330','0','0','0','0','0','0','','','0','0','0','0'); -- id=2263
UPDATE product SET productName = ' موديل 330 ابراهيم الجمل ', productDescription = '', productCatId = '200', productBuyPrice = '330', productSellAllPrice = '330', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02263',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '330',meanbuyprice_withDiscount = '330' , productbuypricereal = '330' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='330',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='330',meanbuyprice_withTax='330',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='330',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2263';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2263', '1', '2026-10-20', '5', '0','0226301','330','0','0','330','','0','0','0','0','0','0','0','0','0','0'); -- id=2263
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2263', '1', '0', '5', '2026-10-20'); -- id=3656
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2263', '1', '0', '0', '2263', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15210
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2263, 1,'2026-10-20 10:44:32',5)
                ON DUPLICATE KEY UPDATE productid = 2263, edited = 1, sysdate = '2026-10-20 10:44:32', userid = 5; -- id=3309
UPDATE product SET productName = ' موديل 330 ابراهيم الجمل ', productDescription = '', productCatId = '200', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02263',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '330',meanbuyprice_withDiscount = '330' , productbuypricereal = '330' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='330',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='330',meanbuyprice_withTax='330',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='330',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2263';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:14:34";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:44:34", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:44:34', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15159
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:14:35";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:44:35", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:44:35', '5', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15160
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', '5', '2026-10-20 10:44:59', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=198
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 ('198', '0', '', '0', 'إضافة مورد جديد', '198', '', '2026-10-20 10:44:59', '5', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=748
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', '', '5', '0', '2026-10-20 10:44:59'); -- id=685
UPDATE supplier SET suppliername = 'ابراهيم الجمل ', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '5', supplierdate = '2026-10-20', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='685',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '198';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:15:20";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:45:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:45:20', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15161

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad71b0f6095b
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno,returnsellbilltypeclientid) VALUES ('2026-10-20 10:45:20', '06ad71b0f6095b', '1', '0.00', '0', '0', '1', '1920', '1920', '-1920', '0', '1', '2026-10-20 10:45:20', '', '2', '0', 'نقدي','2', '0', '5', '0', 'نقدي', '6', '0', '', '','','','-1','0','0','0','','0','-1920','0','0','0','0','0','0','0','0','-1','0','0','1','','0'); -- id=34
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','1','اضافة فاتورة مردوات مبيعات','34', '0', '2026-10-20 10:45:20', '2', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '1920', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 10:45:20','0','0','',''); -- id=1313
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('300.00', '08562', '34', '25', '891', '6', '320', '1920', '0', '', '0', '0', '891', '0.00', '0','1','0','','','0','0','0','0','0','0','1','1','','0','0','320','1920','0','','0'); -- id=50
UPDATE returnsellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where returnsellbilldetailid = 50;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (891, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1920, 1800, 1800, 1800
                    , 1800, 1800, 1800, 0, 6, 0, 0, 1800, 1800)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1920, returnSellCostBuyPrice = returnSellCostBuyPrice+1800, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1800
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1800, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1800
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1800
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1800
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1800
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1800
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+6;
 INSERT 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-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1920, 1800, 1800, 1800
                    , 1800, 1800, 1800, 0, 0, 1800, 1800)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1920, returnSellCostBuyPrice = returnSellCostBuyPrice+1800, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1800
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1800, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1800
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1800
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1800
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1800
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1800;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2026-10-20 10:45:20' WHERE storedetailid = '891';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('891', '1', '6', '0', '34', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '0', '6', '2', '2026-10-20 10:45:20','0','0'); -- id=15211
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6810668.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6812588.5','-1920', '1', '2', 'اضافة فاتورة مردوات مبيعات', '34', '6810668.5', '2026-10-20 10:45:20', '2',  'returnsellbillController.php','1','','0'); -- id=1357
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1920', '1920', '2026-10-20', '2', '0', '0', '2026-10-20 10:45:20','اضافة فاتورة مردود مبيعات رقم 34','1','0',null,'0','34','returnsellbillController.php?do=showDetail&returnsellbillid=34'); -- id=3922
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3922', '143', '1920', '','0'); -- id=4025
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12444005', 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 dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3922', '419', '1920', '','0'); -- id=3924
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6810668', 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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1800', '1800', '2026-10-20', '2', '0', '0', '2026-10-20 10:45:20','اضافة فاتورة مردود مبيعات رقم 34 - صرف البضاعة من المخزن','1','0',null,'0','34','returnsellbillController.php?do=showDetail&returnsellbillid=34'); -- id=3923
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3923', '382', '1800', '','0'); -- id=4026
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23968632.39', 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 ('3923', '402', '1800', '','0'); -- id=3925
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11515298.81', 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';
update returnsellbill set dailyentryid='3922,0,3923' where returnsellbillid=34;
 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-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1920, 1800, 1800, 1800
                    , 1800, 1800, 1800 ,0, 0, 1800, 1800)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1920, returnSellCostBuyPrice = returnSellCostBuyPrice+1800, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1800
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1800, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1800
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1800
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1800
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1800
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1800;
 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-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1920, 1800, 1800, 1800
                    , 1800, 1800, 1800 ,0, 0, 1800, 1800)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1920, returnSellCostBuyPrice = returnSellCostBuyPrice+1800, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1800
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1800, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1800
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1800
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1800
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1800
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1800;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -1920, -1800, -1800
                    , -1800, -1800, -1800, -1800, -1800, -1800)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-1920, netSellCostBuyPrice = netSellCostBuyPrice+-1800
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-1800
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-1800
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-1800
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-1800
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-1800
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-1800
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-1800;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad71b0f6095b and sellbillId = 34 and returnsellbillId = 34
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:15:20";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:45:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:45:20', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15162
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:15:31";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:45:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:45:31', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15163
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:17:24";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:47:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 10:47:24', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15164
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-20 07:17:24";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 10:47:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 10:47:24', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15165
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:17:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:47:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:47:28', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15166
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:17:36";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:47:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:47:36', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15167

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad71c1be6a83
-- ----------------------------------------------------------------------------------------------------

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-20 10:47:36', '06ad71c1be6a83', '1', '0.00', '0', '0', '1', '1600.00', '1600', '1600', '0', '1', '2026-10-20 10:47:36', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','1600','0','','0','0','1600','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1098
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','اضافة فاتورة مبيعات','1098', '0', '2026-10-20 10:47:36', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1600', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 10:47:36','0','0','',''); -- id=1314
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','07068', '1098', '13', '779', '5', '320', '1600', '0', '', '0', '2026-10-20 10:47:36', '779', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','320','1600','0','','0','0.00','0','0','0','0'); -- id=4386
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 4386;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (779, '2026-10-20', 1600, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1600, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-20', 1600, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1600, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '2', storedetaildate = '2026-10-20 10:47:36' WHERE storedetailid = '779';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('779', '1', '5', '1', '1098', 'اضافة فاتورة مبيعات', 'sellbillController.php', '26', '21', '2', '2026-10-20 10:47:36','0','0'); -- id=15212
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6812268.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6810668.5','1600', '0', '2', 'اضافة فاتورة مبيعات', '1098', '6812268.5', '2026-10-20 10:47:36', '2',  'sellbillController.php','1','','0'); -- id=1358
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1600', '1600', '2026-10-20', '2', '0', '0', '2026-10-20 10:47:36','اضافة فاتورة مبيعات رقم 1098','1','0',null,'0','1098','sellbillController.php?do=showDetail&sellbillid=1098'); -- id=3924
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3924', '419', '1600', '','0'); -- id=4027
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6812268', 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 ('3924', '143', '1600', '','0'); -- id=3926
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12445605', 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 ( '1500', '1500', '2026-10-20', '2', '0', '0', '2026-10-20 10:47:36','اضافة فاتورة مبيعات رقم 1098 - صرف البضاعة من المخزن','1','0',null,'0','1098','sellbillController.php?do=showDetail&sellbillid=1098'); -- id=3925
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3925', '402', '1500', '','0'); -- id=4028
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11516798.81', 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 ('3925', '382', '1500', '','0'); -- id=3927
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23967132.39', 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='3924,0,3925' where sellbillid=1098;
 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-20', 1600, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1600, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 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-20', 1600, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1600, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1600, 1500, 1500
                    , 1500, 1500, 1500, 1500, 1500, 1500)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1600, netSellCostBuyPrice = netSellCostBuyPrice+1500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1500
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1500
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1500
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1500
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1500
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1500
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1500;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad71c1be6a83 and sellbillId = 1098 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:17:36";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:47:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:47:36', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15168
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:20:22";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:50:22", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:50:22', '5', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15169
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 ('06ad71be38c88a', '2026-10-20 10:44:35', '198', '0.00', '22045.5', '10', '1', '24495.00',  '22045.50', '0', '22045.5', '1', '2026-10-20 10:50:22', '', '5', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=264
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 ('02262', '264', '200', '2262', '51', '325', '16575.00', '0', '', '2026-10-20 10:50:22', '2262','','','0','0','0','0','0',null,'325','16575','0','0','0','0','0','0','0','0','1'); -- id=1483
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:44:35', 1, 2262, 0, 0
                    , 292.5, 51, 0, 0, 5, '2026-10-20 10:50:22')
                ON DUPLICATE KEY UPDATE buyprice = 292.5,
                        buyQuantity =buyQuantity+51, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:50:22' ; -- id=6737
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2262', '325', '51', '0', 'buyBillController.php', '1483', '', '0', '0'); -- id=1090
UPDATE product SET  productBuyPrice = "325" WHERE productId = 2262 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1483 ;
UPDATE product SET productName = 'موديل 325 ابراهيم الجمل ', productDescription = '', productCatId = '200', productBuyPrice = '325.00', productSellAllPrice = '325.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02262',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '325',lastbuyprice_withDiscount = '292.5',meanbuyprice = '325',meanbuyprice_withDiscount = '292.5' , productbuypricereal = '325.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='325',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='325',meanbuyprice_withTax='325',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='292.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2262';
UPDATE buybilldetail SET  lastbuyprice = 325 , meanbuyprice = 325, lastbuyprice_withDiscount = 292.5, meanbuyprice_withDiscount = 292.5
        , lastbuyprice_withTax = 325, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 292.5
                where buybilldetailid = 1483;
UPDATE productunit SET proUnitBuyPrice  = 325 * productnumber WHERE productid = 2262;
UPDATE storedetail SET  productquantity = '51', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3655';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2262', '1', '51', '0', '264', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '51', '5', '2026-10-20 10:44:35','0','0'); -- id=15213
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 ('02263', '264', '200', '2263', '24', '330', '7920.00', '0', '', '2026-10-20 10:50:22', '2263','','','0','0','0','0','0',null,'330','7920','0','0','0','0','0','0','0','0','1'); -- id=1484
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 10:44:35', 1, 2263, 0, 0
                    , 297, 24, 0, 0, 5, '2026-10-20 10:50:22')
                ON DUPLICATE KEY UPDATE buyprice = 297,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 10:50:22' ; -- id=6738
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2263', '330', '24', '0', 'buyBillController.php', '1484', '', '0', '0'); -- id=1091
UPDATE product SET  productBuyPrice = "330" WHERE productId = 2263 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1484 ;
UPDATE product SET productName = ' موديل 330 ابراهيم الجمل ', productDescription = '', productCatId = '200', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02263',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '297',meanbuyprice = '330',meanbuyprice_withDiscount = '297' , productbuypricereal = '330.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='330',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='330',meanbuyprice_withTax='330',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='297',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2263';
UPDATE buybilldetail SET  lastbuyprice = 330 , meanbuyprice = 330, lastbuyprice_withDiscount = 297, meanbuyprice_withDiscount = 297
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 297
                where buybilldetailid = 1484;
UPDATE productunit SET proUnitBuyPrice  = 330 * productnumber WHERE productid = 2263;
UPDATE storedetail SET  productquantity = '24', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3656';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2263', '1', '24', '0', '264', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '5', '2026-10-20 10:44:35','0','0'); -- id=15214
UPDATE supplier SET  suppliercurrentDebt = '22045.5',suppliercurrentDebtInCurrency= '22045.5' , userid = '5', supplierdate = '2026-10-20 10:50:22'   WHERE supplierid = '198';
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 ('198', '0.00', '22045.5', '0', 'اضافة فاتورة مشتريات', '264', '22045.5', '2026-10-20 10:44:35', '5', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','22045.5','1','0','22045.5','22045.5','0',''); -- id=749
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '22045.5', '22045.5', '2026-10-20', '5', '0', '0', '2026-10-20 10:50:22','اضافة فاتورة مشتريات رقم 264','1','0',null,'0','264','buyBillController.php?do=details&id=264'); -- id=3926
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3926', '382', '22045.5', '','0'); -- id=4029
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23989177.89', 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 ('3926', '685', '22045.5', '','0'); -- id=3928
UPDATE accountstree SET name = 'ابراهيم الجمل ', customName = 'ابراهيم الجمل ', customNameEn = 'ابراهيم الجمل ', nameEn = 'ابراهيم الجمل ', parent = '81', accountNature = '1', theValue = '22045.5', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '5', del = '0', sysdate = '2026-10-20 10:44:59' WHERE id = '685';
update buybill set dailyentryid='3926,0' where buybillid=264;
COMMIT;
UPDATE product SET overAllAveragePrice = 292.5 WHERE productId = 2262;UPDATE product SET overAllAveragePrice = 297 WHERE productId = 2263;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:20:23";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:50:23", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:50:23', '5', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=264'); -- id=15170
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:20:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:50:28", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:50:28', '5', 'showbarcodebuybill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=264&type=2'); -- id=15171
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:22:45";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:52:45", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:52:45', '5', 'showbarcodebuybill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=264&type=2'); -- id=15172
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:22:48";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:52:48", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:52:48', '5', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=264'); -- id=15173
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:22:51";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:52:51", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 10:52:51', '5', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15174
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:22:55";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:52:55", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:52:55', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15175
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:22:57";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:52:57", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:52:57', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15176
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:23:02";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:53:02", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 10:53:02', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15177
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:26:46";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:56:46", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:56:46', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15178
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:26:46";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:56:46", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:56:46', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15179
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:26:51";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:56:51", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:56:51', '3', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15180

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7107348211
-- ----------------------------------------------------------------------------------------------------

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-20 10:56:51', '06ad7107348211', '1', '0.00', '0', '0', '1', '5520.00', '5520', '5520', '0', '1', '2026-10-20 10:56:51', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '21' ,'0','','','','','-1','0','0','0','0','0','5520','0','','0','0','5520','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1099
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','اضافة فاتورة مبيعات','1099', '0', '2026-10-20 10:56:51', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5520', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 10:56:51','0','0','',''); -- id=1315
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 1084;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','01923', '1099', '154', '1923', '6', '245', '1470', '0', '', '0', '2026-10-20 10:56:51', '1923', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1084-6,','1','1','0','0','245','1470','0','','0','0.00','0','0','0','0'); -- id=4387
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 4387;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1923, '2026-10-20', 1470, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1470, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '31', userid = '3', storedetaildate = '2026-10-20 10:56:51' WHERE storedetailid = '2940';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1923', '1', '6', '1', '1099', 'اضافة فاتورة مبيعات', 'sellbillController.php', '37', '31', '3', '2026-10-20 10:56:51','0','0'); -- id=15215
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6284;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','02175', '1099', '190', '2175', '6', '245', '1470', '0', '', '0', '2026-10-20 10:56:51', '2175', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6284-6,','1','1','0','0','245','1470','0','','0','0.00','0','0','0','0'); -- id=4388
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 4388;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2175, '2026-10-20', 1470, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1470, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '43', userid = '3', storedetaildate = '2026-10-20 10:56:51' WHERE storedetailid = '3535';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2175', '1', '6', '1', '1099', 'اضافة فاتورة مبيعات', 'sellbillController.php', '49', '43', '3', '2026-10-20 10:56:51','0','0'); -- id=15216
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6087;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02055', '1099', '169', '2055', '3', '270', '810', '0', '', '0', '2026-10-20 10:56:51', '2055', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6087-3,','1','1','0','0','270','810','0','','0','0.00','0','0','0','0'); -- id=4389
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 124.65, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 4389;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2055, '2026-10-20', 810, 750, 750
                    , 750, 750, 750, 750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 750, 373.95, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+810, sellCostBuyPrice =sellCostBuyPrice+750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+373.95
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-20', 810, 750, 750
                    , 750, 750, 750, 750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 750, 373.95, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+810, sellCostBuyPrice =sellCostBuyPrice+750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+373.95
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '107', userid = '3', storedetaildate = '2026-10-20 10:56:51' WHERE storedetailid = '3414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2055', '1', '3', '1', '1099', 'اضافة فاتورة مبيعات', 'sellbillController.php', '110', '107', '3', '2026-10-20 10:56:51','0','0'); -- id=15217
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 1085;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','01924', '1099', '154', '1924', '6', '295', '1770', '0', '', '0', '2026-10-20 10:56:51', '1924', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1085-6,','1','1','0','0','295','1770','0','','0','0.00','0','0','0','0'); -- id=4390
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where sellbilldetailid = 4390;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1924, '2026-10-20', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '78', userid = '3', storedetaildate = '2026-10-20 10:56:51' WHERE storedetailid = '2941';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1924', '1', '6', '1', '1099', 'اضافة فاتورة مبيعات', 'sellbillController.php', '84', '78', '3', '2026-10-20 10:56:51','0','0'); -- id=15218
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6817788.5',  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 ('6812268.5','5520', '0', '2', 'اضافة فاتورة مبيعات', '1099', '6817788.5', '2026-10-20 10:56:51', '3',  'sellbillController.php','1','','0'); -- id=1359
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5520', '5520', '2026-10-20', '3', '0', '0', '2026-10-20 10:56:51','اضافة فاتورة مبيعات رقم 1099','1','0',null,'0','1099','sellbillController.php?do=showDetail&sellbillid=1099'); -- id=3927
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3927', '419', '5520', '','0'); -- id=4030
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6817788', 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 ('3927', '143', '5520', '','0'); -- id=3929
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12451125', 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 ( '5160', '5160', '2026-10-20', '3', '0', '0', '2026-10-20 10:56:51','اضافة فاتورة مبيعات رقم 1099 - صرف البضاعة من المخزن','1','0',null,'0','1099','sellbillController.php?do=showDetail&sellbillid=1099'); -- id=3928
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3928', '402', '5160', '','0'); -- id=4031
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11521958.81', 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 ('3928', '382', '5160', '','0'); -- id=3930
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23984017.89', 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='3927,0,3928' where sellbillid=1099;
 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-20', 5520, 5160, 5160
                    , 5160, 5160, 5160, 5160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5160, 4783.95, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5520, sellCostBuyPrice =sellCostBuyPrice+5160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4783.95
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 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-20', 5520, 5160, 5160
                    , 5160, 5160, 5160, 5160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5160, 4783.95, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5520, sellCostBuyPrice =sellCostBuyPrice+5160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5160
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4783.95
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 5520, 5160, 5160
                    , 5160, 5160, 5160, 5160, 5160, 4783.95)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5520, netSellCostBuyPrice = netSellCostBuyPrice+5160
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5160
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5160
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5160
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5160
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5160
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5160
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4783.95;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7107348211 and sellbillId = 1099 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:26:51";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 10:56:51", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 10:56:51', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15181
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:37:50";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:07:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 11:07:51', '1', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15182
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:38:15";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:08:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 11:08:15', '1', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15183
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:43:45";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:13:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 11:13:45', '1', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15184
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:49:01";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:19:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 11:19:01', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15185
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:49:08";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:19:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 11:19:08', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15186
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:50:10";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:20:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesController.php', '2026-10-20 11:20:10', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/expensesController.php?do=show'); -- id=15187
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:50:42";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:20:42", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesReportController.php', '2026-10-20 11:20:42', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/expensesReportController.php'); -- id=15188
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:50:48";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:20:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('expensesReportController.php', '2026-10-20 11:20:49', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/expensesReportController.php'); -- id=15189
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:50:57";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:20:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 11:20:57', '1', 'all', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15190
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:51:06";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:21:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 11:21:06', '1', 'all', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15191
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:51:33";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:21:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 11:21:33', '1', 'all', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15192
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:51:50";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:21:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 11:21:50', '1', 'all', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15193
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:53:23";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:23:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 11:23:23', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php'); -- id=15194
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:53:41";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:23:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 11:23:41', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15195

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad71c98ddee4
-- ----------------------------------------------------------------------------------------------------

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-20 11:23:41', '06ad71c98ddee4', '1', '0.00', '0', '0', '1', '3000.00', '3000', '3000', '0', '1', '2026-10-20 11:23:41', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','3000','0','','0','0','3000','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1100
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','اضافة فاتورة مبيعات','1100', '0', '2026-10-20 11:23:41', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3000', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 11:23:41','0','0','',''); -- id=1316
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','09779', '1100', '5', '659', '5', '600', '3000', '0', '', '0', '2026-10-20 11:23:41', '659', '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=4391
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 = 4391;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (659, '2026-10-20', 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-20', 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 = '20', userid = '2', storedetaildate = '2026-10-20 11:23:41' WHERE storedetailid = '659';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('659', '1', '5', '1', '1100', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '20', '2', '2026-10-20 11:23:41','0','0'); -- id=15219
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6820788.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6817788.5','3000', '0', '2', 'اضافة فاتورة مبيعات', '1100', '6820788.5', '2026-10-20 11:23:41', '2',  'sellbillController.php','1','','0'); -- id=1360
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3000', '3000', '2026-10-20', '2', '0', '0', '2026-10-20 11:23:41','اضافة فاتورة مبيعات رقم 1100','1','0',null,'0','1100','sellbillController.php?do=showDetail&sellbillid=1100'); -- id=3929
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3929', '419', '3000', '','0'); -- id=4032
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6820788', 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 ('3929', '143', '3000', '','0'); -- id=3931
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12454125', 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 ( '2900', '2900', '2026-10-20', '2', '0', '0', '2026-10-20 11:23:41','اضافة فاتورة مبيعات رقم 1100 - صرف البضاعة من المخزن','1','0',null,'0','1100','sellbillController.php?do=showDetail&sellbillid=1100'); -- id=3930
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3930', '402', '2900', '','0'); -- id=4033
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11524858.81', 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 ('3930', '382', '2900', '','0'); -- id=3932
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23981117.89', 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='3929,0,3930' where sellbillid=1100;
 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-20', 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;
 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-20', 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3000, 2900, 2900
                    , 2900, 2900, 2900, 2900, 2900, 2900)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3000, netSellCostBuyPrice = netSellCostBuyPrice+2900
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2900
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2900
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2900
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2900
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2900
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2900
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2900;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad71c98ddee4 and sellbillId = 1100 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:53:41";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:23:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 11:23:41', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15196
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:53:47";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:23:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 11:23:47', '1', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=add'); -- id=15197
BEGIN;
CALL supplierInUse(173,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
UPDATE supplier SET  suppliercurrentDebt = '199368',suppliercurrentDebtInCurrency= '199368' , userid = '1', supplierdate = '26-10-20'   WHERE supplierid = '173';
UPDATE supplier SET  inUse = 0 where supplierid = 173;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20000', '20000', '2026-10-20', '1', '0', '0', '2026-10-20 11:23:47','تسوية عجز مورد بالزيادة','1','0','0','0','0',''); -- id=3931
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3931', '398', '20000', '','0'); -- id=4034
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '490049.1', 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 ('3931', '656', '20000', '','0'); -- id=3933
UPDATE accountstree SET name = 'ام ام الجابري', customName = 'ام ام الجابري', customNameEn = 'ام ام الجابري', nameEn = 'ام ام الجابري', parent = '81', accountNature = '1', theValue = '199368', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-14 16:13:40' WHERE id = '656';
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 ('173', '179368.00', '20000', '0', 'تسوية عجز مورد بالزيادة', '-1', '199368', '2026-10-20 11:23:47', '1', 'supplierDeficitController.php', 'دفعه تحويل المفروض من الحساب القديم', '3931','', '0','1','1','20000','1','0','0','0','0',''); -- id=750
UPDATE supplierdebtchange SET supplierid = '173', supplierdebtchangebefore = '179368.00', supplierdebtchangeamount = '20000', supplierdebtchangetype = '0', processname = 'تسوية عجز مورد بالزيادة', supplierdebtchangemodelid = '-1', supplierdebtchangeafter = '199368', supplierdebtchangedate = '2026-10-20 11:23:47', userid = '1', tablename = 'supplierDeficitController.php', comment = 'دفعه تحويل المفروض من الحساب القديم', dailyentryid = '3931',saveid = '',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='199368',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='199368', paySerialNo='0',tagids='' WHERE supplierdebtchangeid = '750';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:53:47";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:23:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 11:23:47', '1', 'sucess', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=sucess'); -- id=15198
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:53:49";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:23:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 11:23:49', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=show'); -- id=15199
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:53:53";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:23:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 11:23:53', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php'); -- id=15200
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:54:24";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:24:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 11:24:24', '1', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=add'); -- id=15201
BEGIN;
CALL supplierInUse(119,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
UPDATE supplier SET  suppliercurrentDebt = '106056',suppliercurrentDebtInCurrency= '106056' , userid = '1', supplierdate = '26-10-20'   WHERE supplierid = '119';
UPDATE supplier SET  inUse = 0 where supplierid = 119;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '20000', '20000', '2026-10-20', '1', '0', '0', '2026-10-20 11:24:24','تسوية عجز مورد بالزيادة','1','0','0','0','0',''); -- id=3932
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3932', '398', '20000', '','0'); -- id=4035
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510049.1', 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 ('3932', '602', '20000', '','0'); -- id=3934
UPDATE accountstree SET name = 'ليزر 2', customName = 'ليزر 2', customNameEn = 'ليزر 2', nameEn = 'ليزر 2', parent = '81', accountNature = '1', theValue = '106056', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-08 10:40:45' WHERE id = '602';
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 ('119', '86056.00', '20000', '0', 'تسوية عجز مورد بالزيادة', '-1', '106056', '2026-10-20 11:24:24', '1', 'supplierDeficitController.php', 'تحويل للسيستم القديم', '3932','', '0','1','1','20000','1','0','0','0','0',''); -- id=751
UPDATE supplierdebtchange SET supplierid = '119', supplierdebtchangebefore = '86056.00', supplierdebtchangeamount = '20000', supplierdebtchangetype = '0', processname = 'تسوية عجز مورد بالزيادة', supplierdebtchangemodelid = '-1', supplierdebtchangeafter = '106056', supplierdebtchangedate = '2026-10-20 11:24:24', userid = '1', tablename = 'supplierDeficitController.php', comment = 'تحويل للسيستم القديم', dailyentryid = '3932',saveid = '',currencyId='1',conversionFactor='1',payedInCurrency='20000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='106056',debtchangamountInSupplierCurrency='20000',debtchangafterInSupplierCurrency='106056', paySerialNo='0',tagids='' WHERE supplierdebtchangeid = '751';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:54:25";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:24:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 11:24:25', '1', 'sucess', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=sucess'); -- id=15202
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:54:26";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:24:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 11:24:26', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=show'); -- id=15203
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:54:29";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:24:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 11:24:29', '1', 'all', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15204
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:54:34";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:24:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 11:24:34', '1', 'all', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15205
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:54:41";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:24:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 11:24:41', '1', 'all', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15206
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 07:54:56";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:24:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 11:24:56', '1', 'all', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15207
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:22:45";
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-20 08:22:55";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:52:55", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 11:52:55', '4', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15208
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-20 08:22:55";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 11:52:55", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 11:52:55', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15209
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:22:57";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 11:52:57", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 11:52:57', '4', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15210
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:31:28";
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-20 08:31:43";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:01:43", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 12:01:43', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15211
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-20 08:31:43";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 12:01:43', '5', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15212
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:31:46";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:01:46", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 12:01:46', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15213
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:32:40";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:02:40", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:02:40', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15214
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:32:47";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:02:47", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 12:02:47', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15215
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:33:25";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:03:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:03:25', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15216

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad72e3088274
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno,returnsellbilltypeclientid) VALUES ('2026-10-20 12:03:25', '06ad72e3088274', '1', '0.00', '0', '0', '1', '400', '400', '-400', '0', '1', '2026-10-20 12:03:25', '', '2', '0', 'نقدي','2', '0', '5', '0', 'نقدي', '1', '0', '', '','','','-1','0','0','0','','0','-400','0','0','0','0','0','0','0','0','-1','0','0','1','','0'); -- id=35
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','1','اضافة فاتورة مردوات مبيعات','35', '0', '2026-10-20 12:03:25', '2', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '400', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 12:03:25','0','0','',''); -- id=1317
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('360.00', '01382', '35', '94', '1382', '1', '400', '400', '0', '', '0', '0', '1382', '0.00', '-1','1','0','','','0','0','0','0','0','0','1','1','','0','0','400','400','0','01382','0'); -- id=51
UPDATE returnsellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where returnsellbilldetailid = 51;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1382, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 400, 360, 360, 360
                    , 360, 360, 360, 0, 1, 0, 0, 360, 360)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+400, returnSellCostBuyPrice = returnSellCostBuyPrice+360, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+360
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+360, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+360
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+360
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+360
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+360
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+360
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 400, 360, 360, 360
                    , 360, 360, 360, 0, 0, 360, 360)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+400, returnSellCostBuyPrice = returnSellCostBuyPrice+360, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+360
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+360, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+360
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+360
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+360
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+360
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+360;
UPDATE storedetail SET  productquantity = '1', userid = '2', storedetaildate = '2026-10-20 12:03:25' WHERE storedetailid = '1382';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1382', '1', '1', '0', '35', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '0', '1', '2', '2026-10-20 12:03:25','0','0'); -- id=15220
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6820388.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6820788.5','-400', '1', '2', 'اضافة فاتورة مردوات مبيعات', '35', '6820388.5', '2026-10-20 12:03:25', '2',  'returnsellbillController.php','1','','0'); -- id=1361
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '400', '400', '2026-10-20', '2', '0', '0', '2026-10-20 12:03:25','اضافة فاتورة مردود مبيعات رقم 35','1','0',null,'0','35','returnsellbillController.php?do=showDetail&returnsellbillid=35'); -- id=3933
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3933', '143', '400', '','0'); -- id=4036
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12453725', 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 dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3933', '419', '400', '','0'); -- id=3935
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6820388', 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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '360', '360', '2026-10-20', '2', '0', '0', '2026-10-20 12:03:25','اضافة فاتورة مردود مبيعات رقم 35 - صرف البضاعة من المخزن','1','0',null,'0','35','returnsellbillController.php?do=showDetail&returnsellbillid=35'); -- id=3934
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3934', '382', '360', '','0'); -- id=4037
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23981477.89', 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 ('3934', '402', '360', '','0'); -- id=3936
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11524498.81', 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';
update returnsellbill set dailyentryid='3933,0,3934' where returnsellbillid=35;
 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-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 400, 360, 360, 360
                    , 360, 360, 360 ,0, 0, 360, 360)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+400, returnSellCostBuyPrice = returnSellCostBuyPrice+360, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+360
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+360, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+360
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+360
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+360
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+360
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+360;
 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-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 400, 360, 360, 360
                    , 360, 360, 360 ,0, 0, 360, 360)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+400, returnSellCostBuyPrice = returnSellCostBuyPrice+360, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+360
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+360, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+360
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+360
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+360
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+360
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+360;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -400, -360, -360
                    , -360, -360, -360, -360, -360, -360)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-400, netSellCostBuyPrice = netSellCostBuyPrice+-360
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-360
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-360
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-360
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-360
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-360
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-360
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-360;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad72e3088274 and sellbillId = 35 and returnsellbillId = 35
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:33:25";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:03:25", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:03:25', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15217
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:34:42";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:04:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 12:04:42', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15218
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-20 08:34:43";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 12:04:43", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 12:04:43', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15219
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:34:52";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:04:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:04:52', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15220

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7250d9704c
-- ----------------------------------------------------------------------------------------------------

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-20 12:04:52', '06ad7250d9704c', '1', '0.00', '0', '0', '1', '4935.00', '4935', '4935', '0', '1', '2026-10-20 12:04:52', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '15' ,'0','','','','','-1','0','0','0','0','0','4935','0','','0','0','4935','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1101
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','اضافة فاتورة مبيعات','1101', '0', '2026-10-20 12:04:52', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4935', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 12:04:52','0','0','',''); -- id=1318
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 75;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','01383', '1101', '94', '1383', '6', '330', '1980', '0', '', '0', '2026-10-20 12:04:52', '1383', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','75-6,','1','1','0','0','330','1980','0','','0','0.00','0','0','0','0'); -- id=4392
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 4392;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1383, '2026-10-20', 1980, 1800, 1800
                    , 1800, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1800, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1980, 1800, 1800
                    , 1800, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1800, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '282', userid = '2', storedetaildate = '2026-10-20 12:04:52' WHERE storedetailid = '1383';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1383', '1', '6', '1', '1101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '288', '282', '2', '2026-10-20 12:04:52','0','0'); -- id=15221
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6512;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('363.4','02148', '1101', '187', '2148', '3', '395', '1185', '0', '', '0', '2026-10-20 12:04:52', '2148', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6512-3,','1','1','0','0','395','1185','0','','0','0.00','0','0','0','0'); -- id=4393
UPDATE sellbilldetail SET  lastbuyprice = 395.00 , meanbuyprice = 395.00, lastbuyprice_withDiscount = 363.40, meanbuyprice_withDiscount = 363.40
        , lastbuyprice_withTax = 395, meanbuyprice_withTax = 395, lastbuyprice_withDiscountAndTax = 363.4
                where sellbilldetailid = 4393;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2148, '2026-10-20', 1185, 1185, 1185
                    , 1185, 1090.2, 1090.2, 1090.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1185, 1185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1185, sellCostBuyPrice =sellCostBuyPrice+1185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1090.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1090.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1090.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1185, 1185, 1185
                    , 1185, 1090.2, 1090.2, 1090.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1185, 1185, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1185, sellCostBuyPrice =sellCostBuyPrice+1185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1090.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1090.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1090.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1185
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '57', userid = '2', storedetaildate = '2026-10-20 12:04:52' WHERE storedetailid = '3507';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2148', '1', '3', '1', '1101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '57', '2', '2026-10-20 12:04:52','0','0'); -- id=15222
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 1085;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('275','01924', '1101', '154', '1924', '6', '295', '1770', '0', '', '0', '2026-10-20 12:04:52', '1924', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1085-6,','1','1','0','0','295','1770','0','','0','0.00','0','0','0','0'); -- id=4394
UPDATE sellbilldetail SET  lastbuyprice = 275.00 , meanbuyprice = 275.00, lastbuyprice_withDiscount = 275.00, meanbuyprice_withDiscount = 275.00
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where sellbilldetailid = 4394;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1924, '2026-10-20', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1770, 1650, 1650
                    , 1650, 1650, 1650, 1650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1650, 1650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 12:04:52' WHERE storedetailid = '2941';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1924', '1', '6', '1', '1101', 'اضافة فاتورة مبيعات', 'sellbillController.php', '78', '72', '2', '2026-10-20 12:04:52','0','0'); -- id=15223
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6825323.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6820388.5','4935', '0', '2', 'اضافة فاتورة مبيعات', '1101', '6825323.5', '2026-10-20 12:04:52', '2',  'sellbillController.php','1','','0'); -- id=1362
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4935', '4935', '2026-10-20', '2', '0', '0', '2026-10-20 12:04:52','اضافة فاتورة مبيعات رقم 1101','1','0',null,'0','1101','sellbillController.php?do=showDetail&sellbillid=1101'); -- id=3935
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3935', '419', '4935', '','0'); -- id=4038
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6825323', 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 ('3935', '143', '4935', '','0'); -- id=3937
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12458660', 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 ( '4540.2', '4540.2', '2026-10-20', '2', '0', '0', '2026-10-20 12:04:52','اضافة فاتورة مبيعات رقم 1101 - صرف البضاعة من المخزن','1','0',null,'0','1101','sellbillController.php?do=showDetail&sellbillid=1101'); -- id=3936
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3936', '402', '4540.2', '','0'); -- id=4039
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11529039.01', 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 ('3936', '382', '4540.2', '','0'); -- id=3938
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23976937.69', 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='3935,0,3936' where sellbillid=1101;
 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-20', 4935, 4635, 4635
                    , 4635, 4540.2, 4540.2, 4540.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4635, 4635, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4935, sellCostBuyPrice =sellCostBuyPrice+4635
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4635, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4635
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4540.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4540.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4540.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4635
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4635
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4935, 4635, 4635
                    , 4635, 4540.2, 4540.2, 4540.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4635, 4635, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4935, sellCostBuyPrice =sellCostBuyPrice+4635
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4635, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4635
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4540.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4540.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4540.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4635
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4635
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 4935, 4635, 4635
                    , 4635, 4540.2, 4540.2, 4540.2, 4635, 4635)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4935, netSellCostBuyPrice = netSellCostBuyPrice+4635
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4635
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4635
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4540.2
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4540.2
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4540.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4635
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4635;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7250d9704c and sellbillId = 1101 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:34:52";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:04:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:04:52', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15221
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:42:15";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:12:15", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:12:15', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15222
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:42:21";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:12:21", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:12:21', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15223
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:44:39";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:14:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:14:39', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15224

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad73075554f4
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno,returnsellbilltypeclientid) VALUES ('2026-10-20 12:14:39', '06ad73075554f4', '1', '0.00', '0', '0', '1', '1620', '1620', '-1620', '0', '1', '2026-10-20 12:14:39', '', '2', '0', 'نقدي','2', '0', '5', '0', 'نقدي', '4', '0', '', '','','','-1','0','0','0','','0','-1620','0','0','0','0','0','0','0','0','-1','0','0','1','','0'); -- id=36
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','1','اضافة فاتورة مردوات مبيعات','36', '0', '2026-10-20 12:14:39', '2', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '1620', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 12:14:39','0','0','',''); -- id=1319
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('460.00', '01693', '36', '127', '1693', '1', '460', '460', '0', '', '0', '0', '1693', '0.00', '-1','1','0','','','0','0','0','0','0','0','1','1','','0','0','460','460','0','','0'); -- id=52
UPDATE returnsellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 423.20, meanbuyprice_withDiscount = 423.20
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 423.2
                where returnsellbilldetailid = 52;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1693, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 460, 460, 460, 460
                    , 423.2, 423.2, 423.2, 0, 1, 0, 0, 460, 460)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+460, returnSellCostBuyPrice = returnSellCostBuyPrice+460, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+460
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+460, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+423.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+423.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+423.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+460
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+460
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 460, 460, 460, 460
                    , 423.2, 423.2, 423.2, 0, 0, 460, 460)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+460, returnSellCostBuyPrice = returnSellCostBuyPrice+460, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+460
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+460, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+423.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+423.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+423.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+460
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+460;
UPDATE storedetail SET  productquantity = '21', userid = '2', storedetaildate = '2026-10-20 12:14:39' WHERE storedetailid = '2705';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1693', '1', '1', '0', '36', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '20', '21', '2', '2026-10-20 12:14:39','0','0'); -- id=15224
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('320.00', '01378', '36', '94', '1378', '1', '360', '360', '0', '', '0', '0', '1378', '0.00', '-1','1','0','','','0','0','0','0','0','0','1','1','','0','0','360','360','0','','0'); -- id=53
UPDATE returnsellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where returnsellbilldetailid = 53;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1378, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 360, 320, 320, 320
                    , 320, 320, 320, 0, 1, 0, 0, 320, 320)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+360, returnSellCostBuyPrice = returnSellCostBuyPrice+320, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+320
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+320, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+320
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+320
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+320
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+320
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+320
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+1;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 360, 320, 320, 320
                    , 320, 320, 320, 0, 0, 320, 320)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+360, returnSellCostBuyPrice = returnSellCostBuyPrice+320, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+320
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+320, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+320
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+320
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+320
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+320
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+320;
UPDATE storedetail SET  productquantity = '412', userid = '2', storedetaildate = '2026-10-20 12:14:39' WHERE storedetailid = '1378';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1378', '1', '1', '0', '36', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '411', '412', '2', '2026-10-20 12:14:39','0','0'); -- id=15225
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('360.00', '01382', '36', '94', '1382', '2', '400', '800', '0', '', '0', '0', '1382', '0.00', '-1','1','0','','','0','0','0','0','0','0','1','1','','0','0','400','800','0','','0'); -- id=54
UPDATE returnsellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where returnsellbilldetailid = 54;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1382, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 800, 720, 720, 720
                    , 720, 720, 720, 0, 2, 0, 0, 720, 720)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+800, returnSellCostBuyPrice = returnSellCostBuyPrice+720, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+720
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+720, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+720
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+720
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+720
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+720
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+720
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+2;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 800, 720, 720, 720
                    , 720, 720, 720, 0, 0, 720, 720)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+800, returnSellCostBuyPrice = returnSellCostBuyPrice+720, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+720
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+720, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+720
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+720
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+720
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+720
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+720;
UPDATE storedetail SET  productquantity = '3', userid = '2', storedetaildate = '2026-10-20 12:14:39' WHERE storedetailid = '1382';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1382', '1', '2', '0', '36', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '1', '3', '2', '2026-10-20 12:14:39','0','0'); -- id=15226
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6823703.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6825323.5','-1620', '1', '2', 'اضافة فاتورة مردوات مبيعات', '36', '6823703.5', '2026-10-20 12:14:39', '2',  'returnsellbillController.php','1','','0'); -- id=1363
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1620', '1620', '2026-10-20', '2', '0', '0', '2026-10-20 12:14:39','اضافة فاتورة مردود مبيعات رقم 36','1','0',null,'0','36','returnsellbillController.php?do=showDetail&returnsellbillid=36'); -- id=3937
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3937', '143', '1620', '','0'); -- id=4040
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12457040', 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 dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3937', '419', '1620', '','0'); -- id=3939
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6823703', 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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1463.2', '1463.2', '2026-10-20', '2', '0', '0', '2026-10-20 12:14:39','اضافة فاتورة مردود مبيعات رقم 36 - صرف البضاعة من المخزن','1','0',null,'0','36','returnsellbillController.php?do=showDetail&returnsellbillid=36'); -- id=3938
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3938', '382', '1463.2', '','0'); -- id=4041
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23978400.89', 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 ('3938', '402', '1463.2', '','0'); -- id=3940
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11527575.81', 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';
update returnsellbill set dailyentryid='3937,0,3938' where returnsellbillid=36;
 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-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1620, 1500, 1500, 1500
                    , 1463.2, 1463.2, 1463.2 ,0, 0, 1500, 1500)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1620, returnSellCostBuyPrice = returnSellCostBuyPrice+1500, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1500
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1500, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1463.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1463.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1463.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1500
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1500;
 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-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 1620, 1500, 1500, 1500
                    , 1463.2, 1463.2, 1463.2 ,0, 0, 1500, 1500)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+1620, returnSellCostBuyPrice = returnSellCostBuyPrice+1500, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+1500
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+1500, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+1463.2
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+1463.2
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+1463.2
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+1500
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+1500;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -1620, -1500, -1500
                    , -1500, -1463.2, -1463.2, -1463.2, -1500, -1500)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-1620, netSellCostBuyPrice = netSellCostBuyPrice+-1500
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-1500
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-1500
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-1463.2
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-1463.2
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-1463.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-1500
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-1500;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad73075554f4 and sellbillId = 36 and returnsellbillId = 36
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:44:39";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:14:39", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:14:39', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15225
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:45:06";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:15:06", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:15:06', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15226
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:45:06";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:15:06", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:15:06', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15227
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:46:38";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:16:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 12:16:38', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15228
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-20 08:46:38";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 12:16:38", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 12:16:38', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15229
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:46:42";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:16:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:16:42', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15230

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad72eb44e116
-- ----------------------------------------------------------------------------------------------------

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-20 12:16:42', '06ad72eb44e116', '1', '0.00', '0', '0', '1', '9390.00', '9390', '9390', '0', '1', '2026-10-20 12:16:42', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '24' ,'0','','','','','-1','0','0','0','0','0','9390','0','','0','0','9390','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1102
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','اضافة فاتورة مبيعات','1102', '0', '2026-10-20 12:16:42', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '9390', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 12:16:42','0','0','',''); -- id=1320
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 978;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('429','01884', '1102', '147', '1884', '6', '460', '2760', '0', '', '0', '2026-10-20 12:16:42', '1884', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','978-6,','1','1','0','0','460','2760','0','','0','0.00','0','0','0','0'); -- id=4395
UPDATE sellbilldetail SET  lastbuyprice = 429.00 , meanbuyprice = 429.00, lastbuyprice_withDiscount = 429.00, meanbuyprice_withDiscount = 429.00
        , lastbuyprice_withTax = 429, meanbuyprice_withTax = 429, lastbuyprice_withDiscountAndTax = 429
                where sellbilldetailid = 4395;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1884, '2026-10-20', 2760, 2574, 2574
                    , 2574, 2574, 2574, 2574
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2574, 2574, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2574
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2574, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2574
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2574, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2574
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2574
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2574
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2574
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2760, 2574, 2574
                    , 2574, 2574, 2574, 2574
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2574, 2574, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2760, sellCostBuyPrice =sellCostBuyPrice+2574
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2574, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2574
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2574, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2574
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2574
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2574
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2574
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '162', userid = '2', storedetaildate = '2026-10-20 12:16:42' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '6', '1', '1102', 'اضافة فاتورة مبيعات', 'sellbillController.php', '168', '162', '2', '2026-10-20 12:16:42','0','0'); -- id=15227
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6284;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','02175', '1102', '190', '2175', '6', '245', '1470', '0', '', '0', '2026-10-20 12:16:42', '2175', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6284-6,','1','1','0','0','245','1470','0','','0','0.00','0','0','0','0'); -- id=4396
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 4396;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2175, '2026-10-20', 1470, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1470, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '37', userid = '2', storedetaildate = '2026-10-20 12:16:42' WHERE storedetailid = '3535';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2175', '1', '6', '1', '1102', 'اضافة فاتورة مبيعات', 'sellbillController.php', '43', '37', '2', '2026-10-20 12:16:42','0','0'); -- id=15228
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 5985;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('399.9','02018', '1102', '115', '2018', '6', '430', '2580', '0', '', '0', '2026-10-20 12:16:42', '2018', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','5985-6,','1','1','0','0','430','2580','0','','0','0.00','0','0','0','0'); -- id=4397
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 399.90, meanbuyprice_withDiscount = 399.90
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 399.9
                where sellbilldetailid = 4397;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2018, '2026-10-20', 2580, 2580, 2580
                    , 2580, 2399.4, 2399.4, 2399.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2580, 2580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2399.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2399.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2399.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2580
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2580, 2580, 2580
                    , 2580, 2399.4, 2399.4, 2399.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2580, 2580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2399.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2399.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2399.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2580
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 12:16:42' WHERE storedetailid = '3377';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2018', '1', '6', '1', '1102', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '15', '2', '2026-10-20 12:16:42','0','0'); -- id=15229
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 1120;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01933', '1102', '102', '1933', '6', '430', '2580', '0', '', '0', '2026-10-20 12:16:42', '1933', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1120-6,','1','1','0','0','430','2580','0','','0','0.00','0','0','0','0'); -- id=4398
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 = 4398;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1933, '2026-10-20', 2580, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2580, 2400, 2400
                    , 2400, 2400, 2400, 2400
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 2400, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2400, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2400
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2400
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2400
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '63', userid = '2', storedetaildate = '2026-10-20 12:16:42' WHERE storedetailid = '2950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1933', '1', '6', '1', '1102', 'اضافة فاتورة مبيعات', 'sellbillController.php', '69', '63', '2', '2026-10-20 12:16:42','0','0'); -- id=15230
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6833093.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6823703.5','9390', '0', '2', 'اضافة فاتورة مبيعات', '1102', '6833093.5', '2026-10-20 12:16:42', '2',  'sellbillController.php','1','','0'); -- id=1364
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '9390', '9390', '2026-10-20', '2', '0', '0', '2026-10-20 12:16:42','اضافة فاتورة مبيعات رقم 1102','1','0',null,'0','1102','sellbillController.php?do=showDetail&sellbillid=1102'); -- id=3939
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3939', '419', '9390', '','0'); -- id=4042
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6833093', 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 ('3939', '143', '9390', '','0'); -- id=3941
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12466430', 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 ( '8753.4', '8753.4', '2026-10-20', '2', '0', '0', '2026-10-20 12:16:42','اضافة فاتورة مبيعات رقم 1102 - صرف البضاعة من المخزن','1','0',null,'0','1102','sellbillController.php?do=showDetail&sellbillid=1102'); -- id=3940
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3940', '402', '8753.4', '','0'); -- id=4043
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11536329.21', 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 ('3940', '382', '8753.4', '','0'); -- id=3942
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23969647.49', 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='3939,0,3940' where sellbillid=1102;
 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-20', 9390, 8934, 8934
                    , 8934, 8753.4, 8753.4, 8753.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8934, 8934, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9390, sellCostBuyPrice =sellCostBuyPrice+8934
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8934, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8934
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8753.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8753.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8753.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8934
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8934
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 9390, 8934, 8934
                    , 8934, 8753.4, 8753.4, 8753.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8934, 8934, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9390, sellCostBuyPrice =sellCostBuyPrice+8934
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8934, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8934
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8753.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8753.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8753.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8934
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+8934
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 9390, 8934, 8934
                    , 8934, 8753.4, 8753.4, 8753.4, 8934, 8934)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+9390, netSellCostBuyPrice = netSellCostBuyPrice+8934
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8934
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+8934
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+8753.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+8753.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+8753.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+8934
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+8934;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad72eb44e116 and sellbillId = 1102 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:46:42";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:16:42", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:16:42', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15231
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:47:19";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:17:19", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:17:19', '3', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15232

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7311abc5d8
-- ----------------------------------------------------------------------------------------------------

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-20 12:17:19', '06ad7311abc5d8', '1', '0.00', '0', '0', '1', '3420.00', '3420', '3420', '0', '1', '2026-10-20 12:17:19', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','3420','0','','0','0','3420','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1103
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','اضافة فاتورة مبيعات','1103', '0', '2026-10-20 12:17:19', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '3420', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 12:17:19','0','0','',''); -- id=1321
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','77066', '1103', '75', '1260', '6', '390', '2340', '0', '', '0', '2026-10-20 12:17:19', '1260', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','390','2340','0','','0','0.00','0','0','0','0'); -- id=4399
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 = 4399;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1260, '2026-10-20', 2340, 2220, 2220
                    , 2220, 2220, 2220, 2220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2340, sellCostBuyPrice =sellCostBuyPrice+2220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2340, 2220, 2220
                    , 2220, 2220, 2220, 2220
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2220, 2220, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2340, sellCostBuyPrice =sellCostBuyPrice+2220
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2220, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2220
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2220, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2220
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2220
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2220
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2220
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '550', userid = '3', storedetaildate = '2026-10-20 12:17:19' WHERE storedetailid = '1260';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1260', '1', '6', '1', '1103', 'اضافة فاتورة مبيعات', 'sellbillController.php', '556', '550', '3', '2026-10-20 12:17:19','0','0'); -- id=15231
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 584;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('324','01721', '1103', '49', '1721', '3', '360', '1080', '0', '', '0', '2026-10-20 12:17:19', '1721', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','584-3,','1','1','0','0','360','1080','0','','0','0.00','0','0','0','0'); -- id=4400
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 324.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 324
                where sellbilldetailid = 4400;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1721, '2026-10-20', 1080, 1080, 1080
                    , 1080, 972, 972, 972
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1080, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+972, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+972
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+972
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1080, 1080, 1080
                    , 1080, 972, 972, 972
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1080, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+972, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+972
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+972
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '186', userid = '3', storedetaildate = '2026-10-20 12:17:19' WHERE storedetailid = '2733';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1721', '1', '3', '1', '1103', 'اضافة فاتورة مبيعات', 'sellbillController.php', '189', '186', '3', '2026-10-20 12:17:19','0','0'); -- id=15232
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6836513.5',  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 ('6833093.5','3420', '0', '2', 'اضافة فاتورة مبيعات', '1103', '6836513.5', '2026-10-20 12:17:19', '3',  'sellbillController.php','1','','0'); -- id=1365
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3420', '3420', '2026-10-20', '3', '0', '0', '2026-10-20 12:17:19','اضافة فاتورة مبيعات رقم 1103','1','0',null,'0','1103','sellbillController.php?do=showDetail&sellbillid=1103'); -- id=3941
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3941', '419', '3420', '','0'); -- id=4044
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6836513', 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 ('3941', '143', '3420', '','0'); -- id=3943
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12469850', 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 ( '3192', '3192', '2026-10-20', '3', '0', '0', '2026-10-20 12:17:19','اضافة فاتورة مبيعات رقم 1103 - صرف البضاعة من المخزن','1','0',null,'0','1103','sellbillController.php?do=showDetail&sellbillid=1103'); -- id=3942
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3942', '402', '3192', '','0'); -- id=4045
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11539521.21', 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 ('3942', '382', '3192', '','0'); -- id=3944
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23966455.49', 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='3941,0,3942' where sellbillid=1103;
 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-20', 3420, 3300, 3300
                    , 3300, 3192, 3192, 3192
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3420, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3192, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3192
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3192
                            , 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;
 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-20', 3420, 3300, 3300
                    , 3300, 3192, 3192, 3192
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3300, 3300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3420, sellCostBuyPrice =sellCostBuyPrice+3300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3192, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3192
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3192
                            , 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 3420, 3300, 3300
                    , 3300, 3192, 3192, 3192, 3300, 3300)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+3420, netSellCostBuyPrice = netSellCostBuyPrice+3300
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3300
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3300
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3192
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3192
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3192
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3300
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3300;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7311abc5d8 and sellbillId = 1103 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:47:20";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:17:20", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:17:20', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15233
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:47:34";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:17:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:17:34', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15234

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7317b07915
-- ----------------------------------------------------------------------------------------------------

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-20 12:17:34', '06ad7317b07915', '1', '0.00', '0', '0', '1', '2400.00', '2400', '2400', '0', '1', '2026-10-20 12:17:34', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2400','0','','0','0','2400','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1104
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','اضافة فاتورة مبيعات','1104', '0', '2026-10-20 12:17:34', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2400', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 12:17:34','0','0','',''); -- id=1322
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6679;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','02246', '1104', '196', '2246', '6', '400', '2400', '0', '', '0', '2026-10-20 12:17:34', '2246', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6679-6,','1','1','0','0','400','2400','0','','0','0.00','0','0','0','0'); -- id=4401
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 4401;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2246, '2026-10-20', 2400, 2400, 2400
                    , 2400, 2160, 2280, 2160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2400, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2400, 2400, 2400
                    , 2400, 2160, 2280, 2160
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2400, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '22', userid = '2', storedetaildate = '2026-10-20 12:17:34' WHERE storedetailid = '3637';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2246', '1', '6', '1', '1104', 'اضافة فاتورة مبيعات', 'sellbillController.php', '28', '22', '2', '2026-10-20 12:17:34','0','0'); -- id=15233
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6838913.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6836513.5','2400', '0', '2', 'اضافة فاتورة مبيعات', '1104', '6838913.5', '2026-10-20 12:17:34', '2',  'sellbillController.php','1','','0'); -- id=1366
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2400', '2400', '2026-10-20', '2', '0', '0', '2026-10-20 12:17:34','اضافة فاتورة مبيعات رقم 1104','1','0',null,'0','1104','sellbillController.php?do=showDetail&sellbillid=1104'); -- id=3943
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3943', '419', '2400', '','0'); -- id=4046
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6838913', 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 ('3943', '143', '2400', '','0'); -- id=3945
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12472250', 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 ( '2160', '2160', '2026-10-20', '2', '0', '0', '2026-10-20 12:17:34','اضافة فاتورة مبيعات رقم 1104 - صرف البضاعة من المخزن','1','0',null,'0','1104','sellbillController.php?do=showDetail&sellbillid=1104'); -- id=3944
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3944', '402', '2160', '','0'); -- id=4047
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11541681.21', 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 ('3944', '382', '2160', '','0'); -- id=3946
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23964295.49', 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='3943,0,3944' where sellbillid=1104;
 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-20', 2400, 2400, 2400
                    , 2400, 2160, 2280, 2160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2400, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2400, 2400, 2400
                    , 2400, 2160, 2280, 2160
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2400, 1200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2400, sellCostBuyPrice =sellCostBuyPrice+2400
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2400, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2400
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2160, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2160
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2400
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1200
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 2400, 2400, 2400
                    , 2400, 2160, 2280, 2160, 2400, 1200)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2400, netSellCostBuyPrice = netSellCostBuyPrice+2400
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2400
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2400
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2160
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2280
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2160
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2400
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1200;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7317b07915 and sellbillId = 1104 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:47:34";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:17:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:17:34', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15235
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:47:57";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:17:57", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:17:57', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15236
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:47:57";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:17:57", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:17:57', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15237
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:48:02";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:18:02", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 12:18:02', '4', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15238
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:48:07";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:18:07", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:18:07', '4', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15239
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:53:10";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:23:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 12:23:10', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15240
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-20 08:53:10";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 12:23:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 12:23:10', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15241
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:53:13";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:23:13", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:23:13', '3', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15242

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad731c5de5e6
-- ----------------------------------------------------------------------------------------------------

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-20 12:23:13', '06ad731c5de5e6', '1', '0.00', '0', '0', '1', '1800.00', '1800', '1800', '0', '1', '2026-10-20 12:23:13', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '5' ,'0','','','','','-1','0','0','0','0','0','1800','0','','0','0','1800','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1105
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','اضافة فاتورة مبيعات','1105', '0', '2026-10-20 12:23:13', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1800', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 12:23:13','0','0','',''); -- id=1323
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6621;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','78054', '1105', '33', '1041', '5', '360', '1800', '0', '', '0', '2026-10-20 12:23:13', '1041', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6621-5,','1','1','0','0','360','1800','0','','0','0.00','0','0','0','0'); -- id=4402
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 4402;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1041, '2026-10-20', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '95', userid = '3', storedetaildate = '2026-10-20 12:23:13' WHERE storedetailid = '1041';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1041', '1', '5', '1', '1105', 'اضافة فاتورة مبيعات', 'sellbillController.php', '100', '95', '3', '2026-10-20 12:23:13','0','0'); -- id=15234
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6840713.5',  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 ('6838913.5','1800', '0', '2', 'اضافة فاتورة مبيعات', '1105', '6840713.5', '2026-10-20 12:23:13', '3',  'sellbillController.php','1','','0'); -- id=1367
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1800', '1800', '2026-10-20', '3', '0', '0', '2026-10-20 12:23:13','اضافة فاتورة مبيعات رقم 1105','1','0',null,'0','1105','sellbillController.php?do=showDetail&sellbillid=1105'); -- id=3945
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3945', '419', '1800', '','0'); -- id=4048
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6840713', 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 ('3945', '143', '1800', '','0'); -- id=3947
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12474050', 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 ( '1700', '1700', '2026-10-20', '3', '0', '0', '2026-10-20 12:23:13','اضافة فاتورة مبيعات رقم 1105 - صرف البضاعة من المخزن','1','0',null,'0','1105','sellbillController.php?do=showDetail&sellbillid=1105'); -- id=3946
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3946', '402', '1700', '','0'); -- id=4049
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11543381.21', 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 ('3946', '382', '1700', '','0'); -- id=3948
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23962595.49', 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='3945,0,3946' where sellbillid=1105;
 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-20', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700, 1700, 1700)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1800, netSellCostBuyPrice = netSellCostBuyPrice+1700
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1700
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1700
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1700
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1700
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1700
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1700
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1700;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad731c5de5e6 and sellbillId = 1105 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:53:13";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:23:13", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:23:13', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15243
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:53:16";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:23:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:23:16', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15244

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad731aecbc08
-- ----------------------------------------------------------------------------------------------------

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-20 12:23:16', '06ad731aecbc08', '1', '0.00', '0', '0', '1', '37995.00', '37995', '37995', '0', '1', '2026-10-20 12:23:16', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '99' ,'0','','','','','-1','0','0','0','0','0','37995','0','','0','0','37995','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1106
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','اضافة فاتورة مبيعات','1106', '0', '2026-10-20 12:23:16', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '37995', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 12:23:16','0','0','',''); -- id=1324
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 568;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('427.8','01705', '1106', '128', '1705', '6', '465', '2790', '0', '', '0', '2026-10-20 12:23:16', '1705', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','568-6,','1','1','0','0','465','2790','0','','0','0.00','0','0','0','0'); -- id=4403
UPDATE sellbilldetail SET  lastbuyprice = 465.00 , meanbuyprice = 465.00, lastbuyprice_withDiscount = 427.80, meanbuyprice_withDiscount = 446.40
        , lastbuyprice_withTax = 465, meanbuyprice_withTax = 232.5, lastbuyprice_withDiscountAndTax = 427.8
                where sellbilldetailid = 4403;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1705, '2026-10-20', 2790, 2790, 2790
                    , 2790, 2566.8, 2678.4, 2566.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2790, 1395, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2790, sellCostBuyPrice =sellCostBuyPrice+2790
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2790, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2790
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2566.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2678.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2566.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2790
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1395
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2790, 2790, 2790
                    , 2790, 2566.8, 2678.4, 2566.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2790, 1395, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2790, sellCostBuyPrice =sellCostBuyPrice+2790
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2790, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2790
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2566.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2678.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2566.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2790
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1395
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '2', storedetaildate = '2026-10-20 12:23:16' WHERE storedetailid = '2717';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1705', '1', '6', '1', '1106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '18', '2', '2026-10-20 12:23:16','0','0'); -- id=15235
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6738;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('297','02263', '1106', '200', '2263', '9', '330', '2970', '0', '', '0', '2026-10-20 12:23:16', '2263', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6738-9,','1','1','0','0','330','2970','0','','0','0.00','0','0','0','0'); -- id=4404
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 297.00, meanbuyprice_withDiscount = 297.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 297
                where sellbilldetailid = 4404;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2263, '2026-10-20', 2970, 2970, 2970
                    , 2970, 2673, 2673, 2673
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2970, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2970, sellCostBuyPrice =sellCostBuyPrice+2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2673, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2673
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2673
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2970
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2970, 2970, 2970
                    , 2970, 2673, 2673, 2673
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2970, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2970, sellCostBuyPrice =sellCostBuyPrice+2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2673, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2673
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2673
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2970
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 12:23:16' WHERE storedetailid = '3656';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2263', '1', '9', '1', '1106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '15', '2', '2026-10-20 12:23:16','0','0'); -- id=15236
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6737;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('292.5','02262', '1106', '200', '2262', '9', '325', '2925', '0', '', '0', '2026-10-20 12:23:16', '2262', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6737-9,','1','1','0','0','325','2925','0','','0','0.00','0','0','0','0'); -- id=4405
UPDATE sellbilldetail SET  lastbuyprice = 325.00 , meanbuyprice = 325.00, lastbuyprice_withDiscount = 292.50, meanbuyprice_withDiscount = 292.50
        , lastbuyprice_withTax = 325, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 292.5
                where sellbilldetailid = 4405;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2262, '2026-10-20', 2925, 2925, 2925
                    , 2925, 2632.5, 2632.5, 2632.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2925, 2925, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2925, sellCostBuyPrice =sellCostBuyPrice+2925
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2925, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2925
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2632.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2632.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2632.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2925
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2925
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2925, 2925, 2925
                    , 2925, 2632.5, 2632.5, 2632.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2925, 2925, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2925, sellCostBuyPrice =sellCostBuyPrice+2925
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2925, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2925
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2632.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2632.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2632.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2925
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2925
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '42', userid = '2', storedetaildate = '2026-10-20 12:23:16' WHERE storedetailid = '3655';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2262', '1', '9', '1', '1106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '51', '42', '2', '2026-10-20 12:23:16','0','0'); -- id=15237
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6638;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('460','02237', '1106', '103', '2237', '9', '480', '4320', '0', '', '0', '2026-10-20 12:23:16', '2237', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6638-9,','1','1','0','0','480','4320','0','','0','0.00','0','0','0','0'); -- id=4406
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where sellbilldetailid = 4406;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2237, '2026-10-20', 4320, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+4140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4320, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+4140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '63', userid = '2', storedetaildate = '2026-10-20 12:23:16' WHERE storedetailid = '3628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2237', '1', '9', '1', '1106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '72', '63', '2', '2026-10-20 12:23:16','0','0'); -- id=15238
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6646;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02243', '1106', '72', '2243', '9', '350', '3150', '0', '', '0', '2026-10-20 12:23:16', '2243', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6646-9,','1','1','0','0','350','3150','0','','0','0.00','0','0','0','0'); -- id=4407
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 4407;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2243, '2026-10-20', 3150, 3150, 3150
                    , 3150, 2835, 2835, 2835
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3150, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2835, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2835
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2835
                            , 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 (1, '2026-10-20', 3150, 3150, 3150
                    , 3150, 2835, 2835, 2835
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3150, 3150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3150, sellCostBuyPrice =sellCostBuyPrice+3150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2835, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2835
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2835
                            , 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 = '30', userid = '2', storedetaildate = '2026-10-20 12:23:16' WHERE storedetailid = '3634';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2243', '1', '9', '1', '1106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '30', '2', '2026-10-20 12:23:16','0','0'); -- id=15239
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6515;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('391','02205', '1106', '187', '2205', '12', '425', '5100', '0', '', '0', '2026-10-20 12:23:16', '2205', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6515-12,','1','1','0','0','425','5100','0','','0','0.00','0','0','0','0'); -- id=4408
UPDATE sellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 425.00, lastbuyprice_withDiscount = 391.00, meanbuyprice_withDiscount = 391.00
        , lastbuyprice_withTax = 425, meanbuyprice_withTax = 425, lastbuyprice_withDiscountAndTax = 391
                where sellbilldetailid = 4408;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2205, '2026-10-20', 5100, 5100, 5100
                    , 5100, 4692, 4692, 4692
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 5100, 5100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5100, sellCostBuyPrice =sellCostBuyPrice+5100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4692, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4692
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4692
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 5100, 5100, 5100
                    , 5100, 4692, 4692, 4692
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5100, 5100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5100, sellCostBuyPrice =sellCostBuyPrice+5100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4692, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4692
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4692
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '48', userid = '2', storedetaildate = '2026-10-20 12:23:16' WHERE storedetailid = '3596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2205', '1', '12', '1', '1106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '48', '2', '2026-10-20 12:23:16','0','0'); -- id=15240
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6546;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('312.8','02234', '1106', '195', '2234', '12', '340', '4080', '0', '', '0', '2026-10-20 12:23:16', '2234', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6546-12,','1','1','0','0','340','4080','0','','0','0.00','0','0','0','0'); -- id=4409
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 312.80, meanbuyprice_withDiscount = 312.80
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 312.8
                where sellbilldetailid = 4409;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2234, '2026-10-20', 4080, 4080, 4080
                    , 4080, 3753.6, 3753.6, 3753.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4080, 4080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4080, sellCostBuyPrice =sellCostBuyPrice+4080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3753.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3753.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3753.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4080, 4080, 4080
                    , 4080, 3753.6, 3753.6, 3753.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4080, 4080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4080, sellCostBuyPrice =sellCostBuyPrice+4080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3753.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3753.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3753.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 12:23:16' WHERE storedetailid = '3625';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2234', '1', '12', '1', '1106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '57', '45', '2', '2026-10-20 12:23:16','0','0'); -- id=15241
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 955;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('324','01877', '1106', '75', '1877', '9', '360', '3240', '0', '', '0', '2026-10-20 12:23:16', '1877', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','955-9,','1','1','0','0','360','3240','0','','0','0.00','0','0','0','0'); -- id=4410
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 342.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 324
                where sellbilldetailid = 4410;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1877, '2026-10-20', 3240, 3240, 3240
                    , 3240, 2916, 3078, 2916
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3240, 1620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3240, sellCostBuyPrice =sellCostBuyPrice+3240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2916, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3078
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2916
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 3240, 3240, 3240
                    , 3240, 2916, 3078, 2916
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3240, 1620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3240, sellCostBuyPrice =sellCostBuyPrice+3240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2916, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3078
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2916
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '2', storedetaildate = '2026-10-20 12:23:16' WHERE storedetailid = '2894';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1877', '1', '9', '1', '1106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '30', '2', '2026-10-20 12:23:16','0','0'); -- id=15242
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6516;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02206', '1106', '48', '2206', '12', '350', '4200', '0', '', '0', '2026-10-20 12:23:16', '2206', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6516-12,','1','1','0','0','350','4200','0','','0','0.00','0','0','0','0'); -- id=4411
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 4411;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2206, '2026-10-20', 4200, 4200, 4200
                    , 4200, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , 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 (1, '2026-10-20', 4200, 4200, 4200
                    , 4200, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4200, 4200, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4200, sellCostBuyPrice =sellCostBuyPrice+4200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , 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 = '0', userid = '2', storedetaildate = '2026-10-20 12:23:16' WHERE storedetailid = '3597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2206', '1', '12', '1', '1106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '0', '2', '2026-10-20 12:23:16','0','0'); -- id=15243
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 1225;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01999', '1106', '78', '1999', '12', '435', '5220', '0', '', '0', '2026-10-20 12:23:16', '1999', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1225-12,','1','1','0','0','435','5220','0','','0','0.00','0','0','0','0'); -- id=4412
UPDATE sellbilldetail SET  lastbuyprice = 410.00 , meanbuyprice = 410.00, lastbuyprice_withDiscount = 410.00, meanbuyprice_withDiscount = 410.00
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 205, lastbuyprice_withDiscountAndTax = 410
                where sellbilldetailid = 4412;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1999, '2026-10-20', 5220, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4920, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5220, sellCostBuyPrice =sellCostBuyPrice+4920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 5220, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4920, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5220, sellCostBuyPrice =sellCostBuyPrice+4920
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4920, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4920
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4920, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4920
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4920
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4920
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-20 12:23:16' WHERE storedetailid = '3016';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1999', '1', '12', '1', '1106', 'اضافة فاتورة مبيعات', 'sellbillController.php', '52', '40', '2', '2026-10-20 12:23:16','0','0'); -- id=15244
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6878708.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6840713.5','37995', '0', '2', 'اضافة فاتورة مبيعات', '1106', '6878708.5', '2026-10-20 12:23:16', '2',  'sellbillController.php','1','','0'); -- id=1368
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '37995', '37995', '2026-10-20', '2', '0', '0', '2026-10-20 12:23:16','اضافة فاتورة مبيعات رقم 1106','1','0',null,'0','1106','sellbillController.php?do=showDetail&sellbillid=1106'); -- id=3947
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3947', '419', '37995', '','0'); -- id=4050
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6878708', 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 ('3947', '143', '37995', '','0'); -- id=3949
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12512045', 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 ( '34908.9', '34908.9', '2026-10-20', '2', '0', '0', '2026-10-20 12:23:16','اضافة فاتورة مبيعات رقم 1106 - صرف البضاعة من المخزن','1','0',null,'0','1106','sellbillController.php?do=showDetail&sellbillid=1106'); -- id=3948
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3948', '402', '34908.9', '','0'); -- id=4051
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11578290.11', 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 ('3948', '382', '34908.9', '','0'); -- id=3950
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23927686.59', 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='3947,0,3948' where sellbillid=1106;
 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-20', 37995, 37515, 37515
                    , 37515, 34908.9, 35182.5, 34908.9
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,37515, 32040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+37995, sellCostBuyPrice =sellCostBuyPrice+37515
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+37515, sellCostMeanBuyPrice = sellCostMeanBuyPrice+37515
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+34908.9, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35182.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+34908.9
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+37515
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+32040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 37995, 37515, 37515
                    , 37515, 34908.9, 35182.5, 34908.9
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,37515, 32040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+37995, sellCostBuyPrice =sellCostBuyPrice+37515
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+37515, sellCostMeanBuyPrice = sellCostMeanBuyPrice+37515
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+34908.9, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+35182.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+34908.9
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+37515
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+32040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 37995, 37515, 37515
                    , 37515, 34908.9, 35182.5, 34908.9, 37515, 32040)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+37995, netSellCostBuyPrice = netSellCostBuyPrice+37515
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+37515
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+37515
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+34908.9
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+35182.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+34908.9
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+37515
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+32040;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad731aecbc08 and sellbillId = 1106 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:53:16";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:23:16", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:23:16', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15245
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:56:35";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:26:35", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 12:26:35', '3', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15246
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:56:36";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:26:36", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 12:26:36', '3', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15247
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:56:45";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:26:45", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:26:45', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15248
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 08:56:46";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:26:46", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:26:46', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15249
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 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-20 09:00:20";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 12:30:20", deviceType = "DESKTOP" 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-20 09:00:20";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 12:30:20", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:00:25";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 12:30:25", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:01:39";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 12:31:39", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:12:34";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 12:42:34", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:24:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:54:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-20 12:54:28', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=15250
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:24:34";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:54:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-20 12:54:34', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierController.php?do=show'); -- id=15251
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:25:41";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:55:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 12:55:41', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15252
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:25:49";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:55:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 12:55:49', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15253
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:25:52";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:55:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 12:55:52', '1', 'details', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=30'); -- id=15254
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:27:51";
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-20 09:28:05";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:58:05", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 12:58:05', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15255
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-20 09:28:05";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 12:58:05', '5', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15256
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:28:09";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:58:09", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 12:58:09', '5', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15257
UPDATE user SET loginip = "" WHERE userid = 3;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:29:23";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:59:23", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:59:23', '4', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15258

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad731cf7490b
-- ----------------------------------------------------------------------------------------------------

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-20 12:59:23', '06ad731cf7490b', '1', '0.00', '0', '0', '1', '2240.00', '2240', '2240', '0', '2', '2026-10-20 12:59:23', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '4' ,'0','','','','','-1','0','0','0','0','0','2240','0','','0','0','2240','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1107
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','اضافة فاتورة مبيعات','1107', '0', '2026-10-20 12:59:23', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2240', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 12:59:23','0','0','',''); -- id=1325
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 6511;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','02096', '1107', '177', '2096', '4', '560', '2240', '0', '', '0', '2026-10-20 12:59:23', '2096', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6511-4,','1','1','0','0','560','2240','0','','0','0.00','0','0','0','0'); -- id=4413
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 4413;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2096, '2026-10-20', 2240, 2120, 2120
                    , 2120, 2120, 2120, 2120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 2120, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2240, sellCostBuyPrice =sellCostBuyPrice+2120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2240, 2120, 2120
                    , 2120, 2120, 2120, 2120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2120, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2240, sellCostBuyPrice =sellCostBuyPrice+2120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '4', storedetaildate = '2026-10-20 12:59:23' WHERE storedetailid = '3594';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2096', '2', '4', '1', '1107', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '0', '4', '2026-10-20 12:59:23','0','0'); -- id=15245
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1080377.875',  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 ('1078137.875','2240', '0', '3', 'اضافة فاتورة مبيعات', '1107', '1080377.875', '2026-10-20 12:59:23', '4',  'sellbillController.php','1','','0'); -- id=1369
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2240', '2240', '2026-10-20', '4', '0', '0', '2026-10-20 12:59:23','اضافة فاتورة مبيعات رقم 1107','1','0',null,'0','1107','sellbillController.php?do=showDetail&sellbillid=1107'); -- id=3949
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3949', '501', '2240', '','0'); -- id=4052
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1080377.9', 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 ('3949', '143', '2240', '','0'); -- id=3951
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12514285', 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 ( '2120', '2120', '2026-10-20', '4', '0', '0', '2026-10-20 12:59:23','اضافة فاتورة مبيعات رقم 1107 - صرف البضاعة من المخزن','1','0',null,'0','1107','sellbillController.php?do=showDetail&sellbillid=1107'); -- id=3950
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3950', '402', '2120', '','0'); -- id=4053
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11580410.11', 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 ('3950', '492', '2120', '','0'); -- id=3952
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1672947.5', 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='3949,0,3950' where sellbillid=1107;
 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-20', 2240, 2120, 2120
                    , 2120, 2120, 2120, 2120
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2120, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2240, sellCostBuyPrice =sellCostBuyPrice+2120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2240, 2120, 2120
                    , 2120, 2120, 2120, 2120
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2120, 2120, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2240, sellCostBuyPrice =sellCostBuyPrice+2120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2120, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2120
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2120
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2120
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 2240, 2120, 2120
                    , 2120, 2120, 2120, 2120, 2120, 2120)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2240, netSellCostBuyPrice = netSellCostBuyPrice+2120
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2120
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2120
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2120
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2120
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2120
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2120
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2120;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad731cf7490b and sellbillId = 1107 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:29:23";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:59:23", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:59:23', '4', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15259
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:29:29";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:59:29", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 12:59:29', '4', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15260
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:29:34";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 12:59:34", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 12:59:34', '4', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15261
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:37:20";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:07:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 13:07:20', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15262
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:37:26";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:07:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 13:07:26', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15263
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:37:53";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:07:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 13:07:53', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15264
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:38:14";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:08:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 13:08:14', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15265
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:42:03";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:12:03", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:12:03', '4', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15266

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad73b8662a17
-- ----------------------------------------------------------------------------------------------------

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-20 13:12:04', '06ad73b8662a17', '1', '0.00', '0', '0', '1', '1770.00', '1770', '1770', '0', '2', '2026-10-20 13:12:04', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','1770','0','','0','0','1770','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1108
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','اضافة فاتورة مبيعات','1108', '0', '2026-10-20 13:12:04', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1770', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 13:12:04','0','0','',''); -- id=1326
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6447;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('265.5','02118', '1108', '182', '2118', '6', '295', '1770', '0', '', '0', '2026-10-20 13:12:04', '2118', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6447-6,','1','1','0','0','295','1770','0','','0','0.00','0','0','0','0'); -- id=4414
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 265.50, meanbuyprice_withDiscount = 265.50
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 265.5
                where sellbilldetailid = 4414;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2118, '2026-10-20', 1770, 1770, 1770
                    , 1770, 1593, 1593, 1593
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1593, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1593
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1593
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1770
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1770, 1770, 1770
                    , 1770, 1593, 1593, 1593
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1593, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1593
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1593
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1770
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '4', storedetaildate = '2026-10-20 13:12:04' WHERE storedetailid = '3576';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2118', '2', '6', '1', '1108', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '27', '4', '2026-10-20 13:12:04','0','0'); -- id=15246
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1082147.875',  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 ('1080377.875','1770', '0', '3', 'اضافة فاتورة مبيعات', '1108', '1082147.875', '2026-10-20 13:12:04', '4',  'sellbillController.php','1','','0'); -- id=1370
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1770', '1770', '2026-10-20', '4', '0', '0', '2026-10-20 13:12:04','اضافة فاتورة مبيعات رقم 1108','1','0',null,'0','1108','sellbillController.php?do=showDetail&sellbillid=1108'); -- id=3951
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3951', '501', '1770', '','0'); -- id=4054
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1082147.9', 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 ('3951', '143', '1770', '','0'); -- id=3953
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12516055', 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 ( '1593', '1593', '2026-10-20', '4', '0', '0', '2026-10-20 13:12:04','اضافة فاتورة مبيعات رقم 1108 - صرف البضاعة من المخزن','1','0',null,'0','1108','sellbillController.php?do=showDetail&sellbillid=1108'); -- id=3952
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3952', '402', '1593', '','0'); -- id=4055
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11582003.11', 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 ('3952', '492', '1593', '','0'); -- id=3954
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1671354.5', 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='3951,0,3952' where sellbillid=1108;
 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-20', 1770, 1770, 1770
                    , 1770, 1593, 1593, 1593
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1593, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1593
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1593
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1770
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1770, 1770, 1770
                    , 1770, 1593, 1593, 1593
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1770, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1593, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1593
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1593
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1770
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 1770, 1770, 1770
                    , 1770, 1593, 1593, 1593, 1770, 1770)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1770, netSellCostBuyPrice = netSellCostBuyPrice+1770
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1770
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1770
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1593
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1593
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1593
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1770
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1770;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad73b8662a17 and sellbillId = 1108 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:42:04";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:12:04", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:12:04', '4', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15267
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:46:42";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:16:42", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:16:42', '4', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15268

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad73e7448516
-- ----------------------------------------------------------------------------------------------------

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-20 13:16:42', '06ad73e7448516', '1', '0.00', '0', '0', '1', '1185.00', '1185', '1185', '0', '2', '2026-10-20 13:16:42', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1185','0','','0','0','1185','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1109
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','اضافة فاتورة مبيعات','1109', '0', '2026-10-20 13:16:42', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1185', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 13:16:42','0','0','',''); -- id=1327
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6455;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('355.5','02122', '1109', '182', '2122', '3', '395', '1185', '0', '', '0', '2026-10-20 13:16:42', '2122', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6455-3,','1','1','0','0','395','1185','0','','0','0.00','0','0','0','0'); -- id=4415
UPDATE sellbilldetail SET  lastbuyprice = 395.00 , meanbuyprice = 395.00, lastbuyprice_withDiscount = 355.50, meanbuyprice_withDiscount = 375.25
        , lastbuyprice_withTax = 395, meanbuyprice_withTax = 197.5, lastbuyprice_withDiscountAndTax = 355.5
                where sellbilldetailid = 4415;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2122, '2026-10-20', 1185, 1185, 1185
                    , 1185, 1066.5, 1125.75, 1066.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1185, 592.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1185, sellCostBuyPrice =sellCostBuyPrice+1185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1066.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1125.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1066.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+592.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-20', 1185, 1185, 1185
                    , 1185, 1066.5, 1125.75, 1066.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1185, 592.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1185, sellCostBuyPrice =sellCostBuyPrice+1185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1066.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1125.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1066.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+592.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '4', storedetaildate = '2026-10-20 13:16:42' WHERE storedetailid = '3580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2122', '2', '3', '1', '1109', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '15', '4', '2026-10-20 13:16:42','0','0'); -- id=15247
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1083332.875',  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 ('1082147.875','1185', '0', '3', 'اضافة فاتورة مبيعات', '1109', '1083332.875', '2026-10-20 13:16:42', '4',  'sellbillController.php','1','','0'); -- id=1371
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1185', '1185', '2026-10-20', '4', '0', '0', '2026-10-20 13:16:42','اضافة فاتورة مبيعات رقم 1109','1','0',null,'0','1109','sellbillController.php?do=showDetail&sellbillid=1109'); -- id=3953
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3953', '501', '1185', '','0'); -- id=4056
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1083332.9', 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 ('3953', '143', '1185', '','0'); -- id=3955
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12517240', 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 ( '1066.5', '1066.5', '2026-10-20', '4', '0', '0', '2026-10-20 13:16:42','اضافة فاتورة مبيعات رقم 1109 - صرف البضاعة من المخزن','1','0',null,'0','1109','sellbillController.php?do=showDetail&sellbillid=1109'); -- id=3954
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3954', '402', '1066.5', '','0'); -- id=4057
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11583069.61', 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 ('3954', '492', '1066.5', '','0'); -- id=3956
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1670288', 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='3953,0,3954' where sellbillid=1109;
 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-20', 1185, 1185, 1185
                    , 1185, 1066.5, 1125.75, 1066.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1185, 592.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1185, sellCostBuyPrice =sellCostBuyPrice+1185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1066.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1125.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1066.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+592.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 1185, 1185, 1185
                    , 1185, 1066.5, 1125.75, 1066.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1185, 592.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1185, sellCostBuyPrice =sellCostBuyPrice+1185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1066.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1125.75
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1066.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+592.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 1185, 1185, 1185
                    , 1185, 1066.5, 1125.75, 1066.5, 1185, 592.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1185, netSellCostBuyPrice = netSellCostBuyPrice+1185
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1185
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1185
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1066.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1125.75
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1066.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1185
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+592.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad73e7448516 and sellbillId = 1109 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:46:42";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:16:42", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:16:42', '4', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15269
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:57:41";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:27:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 13:27:41', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15270
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:57:59";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:27:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 13:27:59', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15271
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:58:03";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:28:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 13:28:03', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15272
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:59:03";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:29:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 13:29:03', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15273
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:59:12";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:29:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 13:29:12', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15274
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-20 09:59:21";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:29:21", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 13:29:21', '7', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15275
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-20 09:59:21";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 13:29:21', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15276
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 09:59:49";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:29:49", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:29:49', '7', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15277
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:00:04";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:30:04", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:30:04', '7', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15278
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:00:04";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:30:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 13:30:04', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15279
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:00:09";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:30:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 13:30:09', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15280
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:00:34";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:30:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 13:30:34', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15281
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-20 10:00:34";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 13:30:34", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 13:30:34', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15282
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:00:41";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:30:41", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:30:41', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15283
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:00:45";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:30:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:30:45', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15284

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad73304a786e
-- ----------------------------------------------------------------------------------------------------

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-20 13:30:45', '06ad73304a786e', '1', '0.00', '0', '15', '1', '26365.00', '26350', '26350', '0', '1', '2026-10-20 13:30:45', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '82' ,'0','','','','','-1','0','0','0','0','0','26350','0','','0','0','26350','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1110
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','اضافة فاتورة مبيعات','1110', '0', '2026-10-20 13:30:45', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '26350', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 13:30:45','0','0','',''); -- id=1328
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 6709;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','00030', '1110', '40', '1121', '15', '290', '4350', '0', '', '0', '2026-10-20 13:30:45', '1121', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6709-15,','1','1','0','0','290','4350','0','','0','0.00','0','0','0','0'); -- id=4416
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.23, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.23
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260.23, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 4416;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1121, '2026-10-20', 4347.5251280106, 3900, 3900
                    , 3903.45, 3900, 3903.45, 3900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 3900, 3903.45, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4347.5251280106, sellCostBuyPrice =sellCostBuyPrice+3900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3903.45
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3903.45
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3903.45
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (1, '2026-10-20', 4347.5251280106, 3900, 3900
                    , 3903.45, 3900, 3903.45, 3900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3900, 3903.45, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4347.5251280106, sellCostBuyPrice =sellCostBuyPrice+3900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3903.45
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3903.45
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3903.45
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '650', userid = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '1121';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1121', '1', '15', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '665', '650', '2', '2026-10-20 13:30:45','0','0'); -- id=15248
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 203;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','01422', '1110', '3', '1422', '15', '270', '4050', '0', '', '0', '2026-10-20 13:30:45', '1422', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','203-15,','1','1','0','0','270','4050','0','','0','0.00','0','0','0','0'); -- id=4417
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.00, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.00
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 4417;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1422, '2026-10-20', 4047.6958088375, 3900, 3900
                    , 3900, 3900, 3900, 3900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 3900, 3900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4047.6958088375, sellCostBuyPrice =sellCostBuyPrice+3900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (1, '2026-10-20', 4047.6958088375, 3900, 3900
                    , 3900, 3900, 3900, 3900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3900, 3900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4047.6958088375, sellCostBuyPrice =sellCostBuyPrice+3900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '75', userid = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '1435';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1422', '1', '15', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '90', '75', '2', '2026-10-20 13:30:45','0','0'); -- id=15249
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','09740', '1110', '21', '865', '5', '340', '1700', '0', '', '0', '2026-10-20 13:30:45', '865', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','340','1700','0','','0','0.00','0','0','0','0'); -- id=4418
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 4418;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (865, '2026-10-20', 1699.0328086478, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1699.0328086478, 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+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-20', 1699.0328086478, 1600, 1600
                    , 1600, 1600, 1600, 1600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1600, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1699.0328086478, 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 = '374', userid = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '865';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('865', '1', '5', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '379', '374', '2', '2026-10-20 13:30:45','0','0'); -- id=15250
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('225','77782', '1110', '21', '858', '5', '245', '1225', '0', '', '0', '2026-10-20 13:30:45', '858', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','245','1225','0','','0','0.00','0','0','0','0'); -- id=4419
UPDATE sellbilldetail SET  lastbuyprice = 225.00 , meanbuyprice = 225.00, lastbuyprice_withDiscount = 225.00, meanbuyprice_withDiscount = 225.00
        , lastbuyprice_withTax = 225, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 225
                where sellbilldetailid = 4419;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (858, '2026-10-20', 1224.3030532903, 1125, 1125
                    , 1125, 1125, 1125, 1125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1125, 1125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1224.3030532903, sellCostBuyPrice =sellCostBuyPrice+1125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1224.3030532903, 1125, 1125
                    , 1125, 1125, 1125, 1125
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1125, 1125, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1224.3030532903, sellCostBuyPrice =sellCostBuyPrice+1125
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1125, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1125
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1125, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1125
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1125
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1125
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1125
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '110', userid = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '858';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('858', '1', '5', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '115', '110', '2', '2026-10-20 13:30:45','0','0'); -- id=15251
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('290','07283', '1110', '33', '1038', '5', '310', '1550', '0', '', '0', '2026-10-20 13:30:45', '1038', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','310','1550','0','','0','0.00','0','0','0','0'); -- id=4420
UPDATE sellbilldetail SET  lastbuyprice = 290.00 , meanbuyprice = 290.00, lastbuyprice_withDiscount = 290.00, meanbuyprice_withDiscount = 290.00
        , lastbuyprice_withTax = 290, meanbuyprice_withTax = 290, lastbuyprice_withDiscountAndTax = 290
                where sellbilldetailid = 4420;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1038, '2026-10-20', 1549.1181490613, 1450, 1450
                    , 1450, 1450, 1450, 1450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1450, 1450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1549.1181490613, sellCostBuyPrice =sellCostBuyPrice+1450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1549.1181490613, 1450, 1450
                    , 1450, 1450, 1450, 1450
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1450, 1450, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1549.1181490613, sellCostBuyPrice =sellCostBuyPrice+1450
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1450, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1450
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1450, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1450
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1450
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1450
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1450
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '1038';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1038', '1', '5', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '28', '2', '2026-10-20 13:30:45','0','0'); -- id=15252
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6424;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('432.4','02199', '1110', '173', '2199', '3', '470', '1410', '0', '', '0', '2026-10-20 13:30:45', '2199', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6424-3,','1','1','0','0','470','1410','0','','0','0.00','0','0','0','0'); -- id=4421
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 432.40, meanbuyprice_withDiscount = 432.40
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 432.4
                where sellbilldetailid = 4421;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2199, '2026-10-20', 1409.1978001138, 1410, 1410
                    , 1410, 1297.2, 1297.2, 1297.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1410, 1410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1409.1978001138, sellCostBuyPrice =sellCostBuyPrice+1410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1297.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1297.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1297.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1409.1978001138, 1410, 1410
                    , 1410, 1297.2, 1297.2, 1297.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1410, 1410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1409.1978001138, sellCostBuyPrice =sellCostBuyPrice+1410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1297.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1297.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1297.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '3568';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2199', '1', '3', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '27', '2', '2026-10-20 13:30:45','0','0'); -- id=15253
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6420;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('423.2','02197', '1110', '173', '2197', '3', '460', '1380', '0', '', '0', '2026-10-20 13:30:45', '2197', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6420-3,','1','1','0','0','460','1380','0','','0','0.00','0','0','0','0'); -- id=4422
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 423.20, meanbuyprice_withDiscount = 423.20
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 423.2
                where sellbilldetailid = 4422;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2197, '2026-10-20', 1379.2148681965, 1380, 1380
                    , 1380, 1269.6, 1269.6, 1269.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1379.2148681965, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1269.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1269.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1269.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1379.2148681965, 1380, 1380
                    , 1380, 1269.6, 1269.6, 1269.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1379.2148681965, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1269.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1269.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1269.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '166', userid = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '3566';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2197', '1', '3', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '169', '166', '2', '2026-10-20 13:30:45','0','0'); -- id=15254
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 6301;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('505','02184', '1110', '190', '2184', '4', '530', '2120', '0', '', '0', '2026-10-20 13:30:45', '2184', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6301-4,','1','1','0','0','530','2120','0','','0','0.00','0','0','0','0'); -- id=4423
UPDATE sellbilldetail SET  lastbuyprice = 505.00 , meanbuyprice = 505.00, lastbuyprice_withDiscount = 505.00, meanbuyprice_withDiscount = 505.00
        , lastbuyprice_withTax = 505, meanbuyprice_withTax = 252.5, lastbuyprice_withDiscountAndTax = 505
                where sellbilldetailid = 4423;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2184, '2026-10-20', 2118.7938554902, 2020, 2020
                    , 2020, 2020, 2020, 2020
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 2020, 1010, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2118.7938554902, sellCostBuyPrice =sellCostBuyPrice+2020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2020, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2020
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2020, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2020
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2020
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2020
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1010
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 2118.7938554902, 2020, 2020
                    , 2020, 2020, 2020, 2020
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2020, 1010, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2118.7938554902, sellCostBuyPrice =sellCostBuyPrice+2020
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2020, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2020
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2020, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2020
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2020
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2020
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1010
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '3544';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2184', '1', '4', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '32', '2', '2026-10-20 13:30:45','0','0'); -- id=15255
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 1170;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','01976', '1110', '59', '1976', '6', '320', '1920', '0', '', '0', '2026-10-20 13:30:45', '1976', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1170-6,','1','1','0','0','320','1920','0','','0','0.00','0','0','0','0'); -- id=4424
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 4424;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1976, '2026-10-20', 1918.9076427081, 1860, 1860
                    , 1860, 1860, 1860, 1860
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1860, 1860, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1918.9076427081, sellCostBuyPrice =sellCostBuyPrice+1860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1860, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1860
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1860, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1860
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1860
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1860
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1860
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1918.9076427081, 1860, 1860
                    , 1860, 1860, 1860, 1860
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1860, 1860, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1918.9076427081, sellCostBuyPrice =sellCostBuyPrice+1860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1860, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1860
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1860, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1860
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1860
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1860
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1860
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '51', userid = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '2993';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1976', '1', '6', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '57', '51', '2', '2026-10-20 13:30:45','0','0'); -- id=15256
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 1169;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 6534;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01975', '1110', '59', '1975', '9', '210', '1890', '0', '', '0', '2026-10-20 13:30:45', '1975', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1169-8,6534-1,','1','1','0','0','210','1890','0','','0','0.00','0','0','0','0'); -- id=4425
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 = 4425;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1975, '2026-10-20', 1888.9247107908, 1800, 1800
                    , 1800, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 1800, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1888.9247107908, sellCostBuyPrice =sellCostBuyPrice+1800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1888.9247107908, 1800, 1800
                    , 1800, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1800, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1888.9247107908, sellCostBuyPrice =sellCostBuyPrice+1800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '41', userid = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '2992';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1975', '1', '9', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '50', '41', '2', '2026-10-20 13:30:45','0','0'); -- id=15257
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6737;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('292.5','02262', '1110', '200', '2262', '6', '325', '1950', '0', '', '0', '2026-10-20 13:30:45', '2262', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6737-6,','1','1','0','0','325','1950','0','','0','0.00','0','0','0','0'); -- id=4426
UPDATE sellbilldetail SET  lastbuyprice = 325.00 , meanbuyprice = 325.00, lastbuyprice_withDiscount = 292.50, meanbuyprice_withDiscount = 292.50
        , lastbuyprice_withTax = 325, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 292.5
                where sellbilldetailid = 4426;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2262, '2026-10-20', 1948.8905746255, 1950, 1950
                    , 1950, 1755, 1755, 1755
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1948.8905746255, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1755, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1755
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1755
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1948.8905746255, 1950, 1950
                    , 1950, 1755, 1755, 1755
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1948.8905746255, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1755, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1755
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1755
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '3655';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2262', '1', '6', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '42', '36', '2', '2026-10-20 13:30:45','0','0'); -- id=15258
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 571;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('432.4','01708', '1110', '128', '1708', '6', '470', '2820', '0', '', '0', '2026-10-20 13:30:45', '1708', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','571-6,','1','1','0','0','470','2820','0','','0','0.00','0','0','0','0'); -- id=4427
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 432.40, meanbuyprice_withDiscount = 451.20
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 432.4
                where sellbilldetailid = 4427;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1708, '2026-10-20', 2818.3956002276, 2820, 2820
                    , 2820, 2594.4, 2707.2, 2594.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2820, 1410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2818.3956002276, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2594.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2707.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2594.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2818.3956002276, 2820, 2820
                    , 2820, 2594.4, 2707.2, 2594.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2820, 1410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2818.3956002276, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2594.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2707.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2594.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2026-10-20 13:30:45' WHERE storedetailid = '2720';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1708', '1', '6', '1', '1110', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '6', '2', '2026-10-20 13:30:45','0','0'); -- id=15259
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6905058.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6878708.5','26350', '0', '2', 'اضافة فاتورة مبيعات', '1110', '6905058.5', '2026-10-20 13:30:45', '2',  'sellbillController.php','1','','0'); -- id=1372
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '26365', '26365', '2026-10-20', '2', '0', '0', '2026-10-20 13:30:45','اضافة فاتورة مبيعات رقم 1110','1','0',null,'0','1110','sellbillController.php?do=showDetail&sellbillid=1110'); -- id=3955
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3955', '419', '26350', '','0'); -- id=4058
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6905058', 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 ('3955', '398', '15', '','0'); -- id=4059
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510064.1', 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 ('3955', '143', '26365', '','0'); -- id=3957
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12543605', 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 ( '24571.2', '24571.2', '2026-10-20', '2', '0', '0', '2026-10-20 13:30:45','اضافة فاتورة مبيعات رقم 1110 - صرف البضاعة من المخزن','1','0',null,'0','1110','sellbillController.php?do=showDetail&sellbillid=1110'); -- id=3956
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3956', '402', '24571.2', '','0'); -- id=4060
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11607640.81', 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 ('3956', '382', '24571.2', '','0'); -- id=3958
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23903115.39', 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='3955,0,3956' where sellbillid=1110;
 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-20', 26350, 25215, 25215
                    , 25218.45, 24571.2, 24687.45, 24571.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,25215, 22798.45, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+26350, sellCostBuyPrice =sellCostBuyPrice+25215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+25215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+25218.45
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+24571.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+24687.45
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+24571.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+25215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22798.45
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 26350, 25215, 25215
                    , 25218.45, 24571.2, 24687.45, 24571.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,25215, 22798.45, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+26350, sellCostBuyPrice =sellCostBuyPrice+25215
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+25215, sellCostMeanBuyPrice = sellCostMeanBuyPrice+25218.45
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+24571.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+24687.45
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+24571.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+25215
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+22798.45
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 26350, 25215, 25215
                    , 25218.45, 24571.2, 24687.45, 24571.2, 25215, 22798.45)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+26350, netSellCostBuyPrice = netSellCostBuyPrice+25215
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+25215
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+25218.45
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+24571.2
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+24687.45
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+24571.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+25215
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+22798.45;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad73304a786e and sellbillId = 1110 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:00:45";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:30:45", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:30:45', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15285
UPDATE user SET loginip = "" WHERE userid = 3;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:01:39";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:31:39", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:31:39', '7', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15286
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:01:53";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:31:53", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:31:53', '7', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15287
UPDATE product SET productName = 'قطن مضلع بريشكا', productDescription = '', productCatId = '59', productBuyPrice = '330.00', productSellAllPrice = '340.00', productSellUnitPrice = '340.00', productSellHalfPrice = '340.00', productDate = '2026-10-14', conditions = '0', userId = '5', limitamount = '0', parcode = '01973',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320.00',lastbuyprice_withDiscount = '320',meanbuyprice = '325.88',meanbuyprice_withDiscount = '325.88' , productbuypricereal = '330.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.03' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='324.81',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='325',meanbuyprice_withTax='325.88',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='320',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1973';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1973, 1,'2026-10-20 13:32:42',7)
                ON DUPLICATE KEY UPDATE productid = 1973, edited = 1, sysdate = '2026-10-20 13:32:42', userid = 7; -- id=2922
UPDATE product SET productName = 'قطن مضلع بريشكا', productDescription = '', productCatId = '59', productBuyPrice = '330.00', productSellAllPrice = '340.00', productSellUnitPrice = '340.00', productSellHalfPrice = '340.00', productDate = '2026-10-14', conditions = '0', userId = '5', limitamount = '0', parcode = '01973',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320.00',lastbuyprice_withDiscount = '320',meanbuyprice = '325.88',meanbuyprice_withDiscount = '325.88' , productbuypricereal = '330.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.03' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='324.81',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='325',meanbuyprice_withTax='325.88',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='320',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1973';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1973, 1,'2026-10-20 13:33:00',7)
                ON DUPLICATE KEY UPDATE productid = 1973, edited = 1, sysdate = '2026-10-20 13:33:00', userid = 7; -- id=2922
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:03:12";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:33:12", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:33:12', '6', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15288

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7135b96686
-- ----------------------------------------------------------------------------------------------------

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-20 13:33:12', '06ad7135b96686', '1', '0.00', '0', '0', '1', '7870.00', '7870', '7870', '0', '1', '2026-10-20 13:33:12', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '14' ,'0','','','','','-1','0','0','0','0','0','7870','0','','0','0','7870','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1111
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','1111', '0', '2026-10-20 13:33:12', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '7870', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 13:33:12','0','0','',''); -- id=1329
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 6724;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('610','02261', '1111', '199', '2261', '8', '635', '5080', '0', '', '0', '2026-10-20 13:33:12', '2261', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6724-8,','1','1','0','0','635','5080','0','','0','0.00','0','0','0','0'); -- id=4428
UPDATE sellbilldetail SET  lastbuyprice = 610.00 , meanbuyprice = 610.00, lastbuyprice_withDiscount = 610.00, meanbuyprice_withDiscount = 610.00
        , lastbuyprice_withTax = 610, meanbuyprice_withTax = 610, lastbuyprice_withDiscountAndTax = 610
                where sellbilldetailid = 4428;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2261, '2026-10-20', 5080, 4880, 4880
                    , 4880, 4880, 4880, 4880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4880, 4880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5080, sellCostBuyPrice =sellCostBuyPrice+4880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 5080, 4880, 4880
                    , 4880, 4880, 4880, 4880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4880, 4880, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5080, sellCostBuyPrice =sellCostBuyPrice+4880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4880
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4880
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-20 13:33:12' WHERE storedetailid = '3652';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2261', '1', '8', '1', '1111', 'اضافة فاتورة مبيعات', 'sellbillController.php', '40', '32', '6', '2026-10-20 13:33:12','0','0'); -- id=15260
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6723;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','02260', '1111', '199', '2260', '6', '465', '2790', '0', '', '0', '2026-10-20 13:33:12', '2260', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6723-6,','1','1','0','0','465','2790','0','','0','0.00','0','0','0','0'); -- id=4429
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 4429;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2260, '2026-10-20', 2790, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2790, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2790, 2700, 2700
                    , 2700, 2700, 2700, 2700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 2700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2790, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '39', userid = '6', storedetaildate = '2026-10-20 13:33:12' WHERE storedetailid = '3651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2260', '1', '6', '1', '1111', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '39', '6', '2026-10-20 13:33:12','0','0'); -- id=15261
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '931090',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('923220','7870', '0', '4', 'اضافة فاتورة مبيعات', '1111', '931090', '2026-10-20 13:33:12', '6',  'sellbillController.php','1','','0'); -- id=1373
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7870', '7870', '2026-10-20', '6', '0', '0', '2026-10-20 13:33:12','اضافة فاتورة مبيعات رقم 1111','1','0',null,'0','1111','sellbillController.php?do=showDetail&sellbillid=1111'); -- id=3957
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3957', '568', '7870', '','0'); -- id=4061
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '931090', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3957', '143', '7870', '','0'); -- id=3959
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12551475', 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 ( '7580', '7580', '2026-10-20', '6', '0', '0', '2026-10-20 13:33:12','اضافة فاتورة مبيعات رقم 1111 - صرف البضاعة من المخزن','1','0',null,'0','1111','sellbillController.php?do=showDetail&sellbillid=1111'); -- id=3958
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3958', '402', '7580', '','0'); -- id=4062
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11615220.81', 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 ('3958', '382', '7580', '','0'); -- id=3960
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23895535.39', 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='3957,0,3958' where sellbillid=1111;
 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-20', 7870, 7580, 7580
                    , 7580, 7580, 7580, 7580
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7580, 7580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7870, sellCostBuyPrice =sellCostBuyPrice+7580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7580
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7580
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 7870, 7580, 7580
                    , 7580, 7580, 7580, 7580
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7580, 7580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7870, sellCostBuyPrice =sellCostBuyPrice+7580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7580, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7580
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7580
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7580
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 7870, 7580, 7580
                    , 7580, 7580, 7580, 7580, 7580, 7580)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7870, netSellCostBuyPrice = netSellCostBuyPrice+7580
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+7580
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+7580
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+7580
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+7580
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+7580
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+7580
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+7580;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7135b96686 and sellbillId = 1111 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:03:12";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:33:12", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:33:12', '6', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15289
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:03:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:33:28", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:33:28', '7', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15290
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:03:31";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:33:31", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 13:33:31', '7', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15291
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:03:51";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:33:51", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:33:51', '6', 'showDetail', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1111'); -- id=15292
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:03:58";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:33:58", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:33:58', '6', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15293
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:04:04";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:34:04", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 13:34:04', '7', 'add', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15294
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 ('06ad7437b6e65d', '2026-10-20 13:33:31', '68', '319055.00', '332915', '0', '0', '13860.00',  '13860.00', '0', '13860', '1', '2026-10-20 13:34:04', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=265
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 ('01973', '265', '59', '1973', '42', '330', '13860.00', '0', '', '2026-10-20 13:34:04', '1973','','','0','0','0','0','0',null,'330','13860','0','0','0','0','0','0','0','0','1'); -- id=1485
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 13:33:31', 1, 1973, 0, 0
                    , 330, 42, 0, 0, 7, '2026-10-20 13:34:04')
                ON DUPLICATE KEY UPDATE buyprice = 330,
                        buyQuantity =buyQuantity+42, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-20 13:34:04' ; -- id=6739
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1973', '330', '42', '0', 'buyBillController.php', '1485', '', '0', '0'); -- id=1092
UPDATE product SET  productBuyPrice = "330" WHERE productId = 1973 ;
UPDATE buybilldetail SET  quantitybefore = 51 WHERE buybilldetailid = 1485 ;
UPDATE product SET productName = 'قطن مضلع بريشكا', productDescription = '', productCatId = '59', productBuyPrice = '330.00', productSellAllPrice = '340.00', productSellUnitPrice = '340.00', productSellHalfPrice = '340.00', productDate = '2026-10-14', conditions = '0', userId = '5', limitamount = '0', parcode = '01973',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '327.74',meanbuyprice_withDiscount = '327.74' , productbuypricereal = '330.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.03' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='324.81',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='330',meanbuyprice_withTax='327.74',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='330',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1973';
UPDATE buybilldetail SET  lastbuyprice = 330 , meanbuyprice = 327.74, lastbuyprice_withDiscount = 330, meanbuyprice_withDiscount = 327.74
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 327.74, lastbuyprice_withDiscountAndTax = 330
                where buybilldetailid = 1485;
UPDATE productunit SET proUnitBuyPrice  = 330 * productnumber WHERE productid = 1973;
UPDATE storedetail SET  productquantity = '93', userid = '7', storedetaildate = '2026-10-20' WHERE storedetailid = '2990';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1973', '1', '42', '0', '265', 'اضافة فاتورة مشتريات', 'buyBillController.php', '51', '93', '7', '2026-10-20 13:33:31','0','0'); -- id=15262
UPDATE supplier SET  suppliercurrentDebt = '332915',suppliercurrentDebtInCurrency= '332915' , userid = '7', supplierdate = '2026-10-20 13:34:04'   WHERE supplierid = '68';
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 ('68', '319055.00', '13860', '0', 'اضافة فاتورة مشتريات', '265', '332915', '2026-10-20 13:33:31', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','13860','1','319055','13860','332915','0',''); -- id=752
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '13860', '13860', '2026-10-20', '7', '0', '0', '2026-10-20 13:34:04','اضافة فاتورة مشتريات رقم 265','1','0',null,'0','265','buyBillController.php?do=details&id=265'); -- id=3959
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3959', '382', '13860', '','0'); -- id=4063
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23909395.39', 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 ('3959', '487', '13860', '','0'); -- id=3961
UPDATE accountstree SET name = 'بريشكا - مورد', customName = 'بريشكا - مورد', customNameEn = 'بريشكا - مورد', nameEn = 'بريشكا - مورد', parent = '81', accountNature = '1', theValue = '126730', 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 = '487';
update buybill set dailyentryid='3959,0' where buybillid=265;
COMMIT;
UPDATE product SET overAllAveragePrice = 326.59 WHERE productId = 1973;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:04:04";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:34:04", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 13:34:04', '7', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=265'); -- id=15295
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:04:34";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:34:34", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:34:34', '7', 'showbarcodebuybill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=265&type=2'); -- id=15296
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:05:41";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:07:09";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:37:09", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:37:09', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15297

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad742d5819a8
-- ----------------------------------------------------------------------------------------------------

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-20 13:37:09', '06ad742d5819a8', '1', '0.00', '0', '0', '1', '7380.00', '7380', '7380', '0', '1', '2026-10-20 13:37:09', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '18' ,'0','','','','','-1','0','0','0','0','0','7380','0','','0','0','7380','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1112
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','اضافة فاتورة مبيعات','1112', '0', '2026-10-20 13:37:09', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '7380', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 13:37:09','0','0','',''); -- id=1330
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 1182;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('423','01983', '1112', '160', '1983', '3', '470', '1410', '0', '', '0', '2026-10-20 13:37:09', '1983', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1182-3,','1','1','0','0','470','1410','0','','0','0.00','0','0','0','0'); -- id=4430
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 423.00, meanbuyprice_withDiscount = 423.00
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 423
                where sellbilldetailid = 4430;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1983, '2026-10-20', 1410, 1410, 1410
                    , 1410, 1269, 1269, 1269
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1410, 1410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1410, sellCostBuyPrice =sellCostBuyPrice+1410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1269, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1269
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1410, 1410, 1410
                    , 1410, 1269, 1269, 1269
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1410, 1410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1410, sellCostBuyPrice =sellCostBuyPrice+1410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1269, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1269
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1269
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '105', userid = '2', storedetaildate = '2026-10-20 13:37:09' WHERE storedetailid = '3000';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1983', '1', '3', '1', '1112', 'اضافة فاتورة مبيعات', 'sellbillController.php', '108', '105', '2', '2026-10-20 13:37:09','0','0'); -- id=15263
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6264;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450.8','02170', '1112', '128', '2170', '3', '490', '1470', '0', '', '0', '2026-10-20 13:37:09', '2170', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6264-3,','1','1','0','0','490','1470','0','','0','0.00','0','0','0','0'); -- id=4431
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 450.80, meanbuyprice_withDiscount = 470.40
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 245, lastbuyprice_withDiscountAndTax = 450.8
                where sellbilldetailid = 4431;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2170, '2026-10-20', 1470, 1470, 1470
                    , 1470, 1352.4, 1411.2, 1352.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1470, 735, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1352.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1411.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1352.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+735
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1470, 1470, 1470
                    , 1470, 1352.4, 1411.2, 1352.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1470, 735, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1470
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1470, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1470
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1352.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1411.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1352.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1470
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+735
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '2', storedetaildate = '2026-10-20 13:37:09' WHERE storedetailid = '3530';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2170', '1', '3', '1', '1112', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '30', '2', '2026-10-20 13:37:09','0','0'); -- id=15264
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 999;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('441.6','01905', '1112', '149', '1905', '6', '480', '2880', '0', '', '0', '2026-10-20 13:37:09', '1905', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','999-6,','1','1','0','0','480','2880','0','','0','0.00','0','0','0','0'); -- id=4432
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 441.60, meanbuyprice_withDiscount = 460.80
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 441.6
                where sellbilldetailid = 4432;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1905, '2026-10-20', 2880, 2880, 2880
                    , 2880, 2649.6, 2764.8, 2649.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2880, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2649.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2764.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2649.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2880
                            , 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-20', 2880, 2880, 2880
                    , 2880, 2649.6, 2764.8, 2649.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2880, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2649.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2764.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2649.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2880
                            , 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 = '12', userid = '2', storedetaildate = '2026-10-20 13:37:09' WHERE storedetailid = '2922';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1905', '1', '6', '1', '1112', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '12', '2', '2026-10-20 13:37:09','0','0'); -- id=15265
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6087;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02055', '1112', '169', '2055', '6', '270', '1620', '0', '', '0', '2026-10-20 13:37:09', '2055', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6087-6,','1','1','0','0','270','1620','0','','0','0.00','0','0','0','0'); -- id=4433
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 124.65, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 4433;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2055, '2026-10-20', 1620, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1500, 747.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1620, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+747.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1620, 1500, 1500
                    , 1500, 1500, 1500, 1500
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1500, 747.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1620, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1500, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1500
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1500
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+747.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '101', userid = '2', storedetaildate = '2026-10-20 13:37:09' WHERE storedetailid = '3414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2055', '1', '6', '1', '1112', 'اضافة فاتورة مبيعات', 'sellbillController.php', '107', '101', '2', '2026-10-20 13:37:09','0','0'); -- id=15266
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6912438.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6905058.5','7380', '0', '2', 'اضافة فاتورة مبيعات', '1112', '6912438.5', '2026-10-20 13:37:09', '2',  'sellbillController.php','1','','0'); -- id=1374
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7380', '7380', '2026-10-20', '2', '0', '0', '2026-10-20 13:37:09','اضافة فاتورة مبيعات رقم 1112','1','0',null,'0','1112','sellbillController.php?do=showDetail&sellbillid=1112'); -- id=3960
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3960', '419', '7380', '','0'); -- id=4064
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6912438', 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 ('3960', '143', '7380', '','0'); -- id=3962
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12558855', 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 ( '6771', '6771', '2026-10-20', '2', '0', '0', '2026-10-20 13:37:09','اضافة فاتورة مبيعات رقم 1112 - صرف البضاعة من المخزن','1','0',null,'0','1112','sellbillController.php?do=showDetail&sellbillid=1112'); -- id=3961
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3961', '402', '6771', '','0'); -- id=4065
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11621991.81', 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 ('3961', '382', '6771', '','0'); -- id=3963
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23902624.39', 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='3960,0,3961' where sellbillid=1112;
 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-20', 7380, 7260, 7260
                    , 7260, 6771, 6945, 6771
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7260, 4332.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7380, sellCostBuyPrice =sellCostBuyPrice+7260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6771, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6945
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6771
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4332.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 7380, 7260, 7260
                    , 7260, 6771, 6945, 6771
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7260, 4332.9, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7380, sellCostBuyPrice =sellCostBuyPrice+7260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6771, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6945
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6771
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4332.9
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 7380, 7260, 7260
                    , 7260, 6771, 6945, 6771, 7260, 4332.9)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7380, netSellCostBuyPrice = netSellCostBuyPrice+7260
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+7260
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+7260
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6771
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6945
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6771
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+7260
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4332.9;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad742d5819a8 and sellbillId = 1112 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:07:10";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:37:10", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:37:10', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15298
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:07:19";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:07:19";
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-20 10:07:24";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:37:24", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 13:37:24', '3', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15299
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-20 10:07:25";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 13:37:25', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15300
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:07:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:37:28", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:37:28', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15301
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:07:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:37:28", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:37:28', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15302
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:11:33";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:41:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 13:41:33', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15303
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:11:38";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:41:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 13:41:38', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15304
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:12:00";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:42:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 13:42:00', '1', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15305
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:12:11";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:42:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 13:42:11', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15306
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-20 10:15:01";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:45:01", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 13:45:01', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15307
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-20 10:15:01";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 13:45:01', '5', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15308
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:15:11";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:45:11", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:45:11', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15309
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:15:20";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:45:20", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:45:20', '5', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15310
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:15:41";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:45:41", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:45:41', '5', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15311
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:16:03";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:46:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 13:46:03', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15312
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:16:08";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:46:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 13:46:08', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15313
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:16:10";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:46:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 13:46:10', '1', 'editbill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=112'); -- id=15314
UPDATE productunit SET proUnitSellAllPrice  = 800.00 * productnumber  WHERE productid = 2097;
UPDATE product SET productName = 'مووديل 7004 ماتيجو', productDescription = '', productCatId = '134', productBuyPrice = '750.00', productSellAllPrice = '800.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02097',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750.00',lastbuyprice_withDiscount = '750',meanbuyprice = '750.00',meanbuyprice_withDiscount = '750' , productbuypricereal = '750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.67' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='750',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='750',meanbuyprice_withTax='750',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='750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2097';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2097, 1,'2026-10-20 13:46:20',5)
                ON DUPLICATE KEY UPDATE productid = 2097, edited = 1, sysdate = '2026-10-20 13:46:20', userid = 5; -- id=3055
UPDATE productunit SET proUnitSellAllPrice  = 750 * productnumber  WHERE productid = 2098;
UPDATE product SET productName = 'موديل 7008 ماتيجو ', productDescription = '', productCatId = '134', productBuyPrice = '700.00', productSellAllPrice = '750', productSellUnitPrice = '720.00', productSellHalfPrice = '720.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02098',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '700.00',lastbuyprice_withDiscount = '700',meanbuyprice = '700.00',meanbuyprice_withDiscount = '700' , productbuypricereal = '700.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.86' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='700',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='700',meanbuyprice_withTax='700',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='700',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2098';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2098, 1,'2026-10-20 13:46:26',5)
                ON DUPLICATE KEY UPDATE productid = 2098, edited = 1, sysdate = '2026-10-20 13:46:26', userid = 5; -- id=3056
UPDATE productunit SET proUnitSellAllPrice  = 750 * productnumber  WHERE productid = 2099;
UPDATE product SET productName = 'موديل 7003 ماتيجو ', productDescription = '', productCatId = '134', productBuyPrice = '700.00', productSellAllPrice = '750', productSellUnitPrice = '720.00', productSellHalfPrice = '720.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02099',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '700.00',lastbuyprice_withDiscount = '700',meanbuyprice = '700.00',meanbuyprice_withDiscount = '700' , productbuypricereal = '700.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.86' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='700',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='700',meanbuyprice_withTax='700',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='700',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2099';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2099, 1,'2026-10-20 13:46:37',5)
                ON DUPLICATE KEY UPDATE productid = 2099, edited = 1, sysdate = '2026-10-20 13:46:37', userid = 5; -- id=3057
UPDATE productunit SET proUnitSellAllPrice  = 800 * productnumber  WHERE productid = 2097;
UPDATE product SET productName = 'مووديل 7004 ماتيجو', productDescription = '', productCatId = '134', productBuyPrice = '750.00', productSellAllPrice = '800', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02097',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750.00',lastbuyprice_withDiscount = '750',meanbuyprice = '750.00',meanbuyprice_withDiscount = '750' , productbuypricereal = '750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.67' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='750',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='750',meanbuyprice_withTax='750',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='750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2097';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2097, 1,'2026-10-20 13:46:40',5)
                ON DUPLICATE KEY UPDATE productid = 2097, edited = 1, sysdate = '2026-10-20 13:46:40', userid = 5; -- id=3055
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:16:59";
UPDATE product SET productName = 'مووديل 7004 ماتيجو ', productDescription = '', productCatId = '134', productBuyPrice = '750.00', productSellAllPrice = '800.00', productSellUnitPrice = '770.00', productSellHalfPrice = '770.00', productDate = '2026-10-15', conditions = '0', userId = '1', limitamount = '0', parcode = '02097',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '750.00',lastbuyprice_withDiscount = '750',meanbuyprice = '750.00',meanbuyprice_withDiscount = '750' , productbuypricereal = '750.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '2.67' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='750',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='750',meanbuyprice_withTax='750',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='750',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2097';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2097, 1,'2026-10-20 13:47:13',5)
                ON DUPLICATE KEY UPDATE productid = 2097, edited = 1, sysdate = '2026-10-20 13:47:13', userid = 5; -- id=3055
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:17:22";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:47:22", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 13:47:22', '5', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15315
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:17:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:47:28", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:47:28', '5', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15316
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:18:05";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:48:05", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:48:05', '5', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15317
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:21:36";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:51:36", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 13:51:36', '4', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15318
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:22:10";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:52:10", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:52:10', '5', 'showbarcode', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15319
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:22:59";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:52:59", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 13:52:59', '5', 'bill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15320
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:23:02";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:53:02", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:53:02', '5', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15321
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:23:10";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:53:10", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 13:53:10', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15322
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:23:12";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:53:12", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 13:53:12', '5', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15323
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-20 10:23:12";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 13:53:12', '5', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15324
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:25:30";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:55:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 13:55:30', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=15325
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:25:35";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:55:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 13:55:35', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=15326
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:25:38";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:55:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 13:55:38', '1', 'edit', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=edit&id=171&parentid=1'); -- id=15327
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:25:55";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:55:55", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:55:55', '6', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15328

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7439636f20
-- ----------------------------------------------------------------------------------------------------

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-20 13:55:55', '06ad7439636f20', '1', '0.00', '0', '0', '1', '4380.00', '4380', '4380', '0', '1', '2026-10-20 13:55:55', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','4380','0','','0','0','4380','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1113
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','1113', '0', '2026-10-20 13:55:55', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4380', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 13:55:55','0','0','',''); -- id=1331
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 58;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01373', '1113', '91', '1373', '3', '470', '1410', '0', '', '0', '2026-10-20 13:55:55', '1373', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','58-3,','1','1','0','0','470','1410','0','','0','0.00','0','0','0','0'); -- id=4434
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 = 4434;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1373, '2026-10-20', 1410, 1230, 1230
                    , 1230, 1230, 1230, 1230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1230, 1230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1410, sellCostBuyPrice =sellCostBuyPrice+1230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1410, 1230, 1230
                    , 1230, 1230, 1230, 1230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1230, 1230, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1410, sellCostBuyPrice =sellCostBuyPrice+1230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1230
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '57', userid = '6', storedetaildate = '2026-10-20 13:55:55' WHERE storedetailid = '1373';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1373', '1', '3', '1', '1113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '60', '57', '6', '2026-10-20 13:55:55','0','0'); -- id=15267
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 55;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('440','01370', '1113', '91', '1370', '3', '500', '1500', '0', '', '0', '2026-10-20 13:55:55', '1370', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','55-3,','1','1','0','0','500','1500','0','','0','0.00','0','0','0','0'); -- id=4435
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 440
                where sellbilldetailid = 4435;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1370, '2026-10-20', 1500, 1320, 1320
                    , 1320, 1320, 1320, 1320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1320, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1500, sellCostBuyPrice =sellCostBuyPrice+1320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1500, 1320, 1320
                    , 1320, 1320, 1320, 1320
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1320, 1320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1500, sellCostBuyPrice =sellCostBuyPrice+1320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1320, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1320
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1320
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '6', storedetaildate = '2026-10-20 13:55:55' WHERE storedetailid = '1370';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1370', '1', '3', '1', '1113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '18', '6', '2026-10-20 13:55:55','0','0'); -- id=15268
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6002;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02021', '1113', '91', '2021', '3', '490', '1470', '0', '', '0', '2026-10-20 13:55:55', '2021', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6002-3,','1','1','0','0','490','1470','0','','0','0.00','0','0','0','0'); -- id=4436
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 = 4436;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2021, '2026-10-20', 1470, 1170, 1170
                    , 1170, 1170, 1170, 1170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1170, 1170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1470, 1170, 1170
                    , 1170, 1170, 1170, 1170
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1170, 1170, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1170, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1170
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1170
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1170
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '216', userid = '6', storedetaildate = '2026-10-20 13:55:55' WHERE storedetailid = '3380';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2021', '1', '3', '1', '1113', 'اضافة فاتورة مبيعات', 'sellbillController.php', '219', '216', '6', '2026-10-20 13:55:55','0','0'); -- id=15269
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '935470',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('931090','4380', '0', '4', 'اضافة فاتورة مبيعات', '1113', '935470', '2026-10-20 13:55:55', '6',  'sellbillController.php','1','','0'); -- id=1375
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4380', '4380', '2026-10-20', '6', '0', '0', '2026-10-20 13:55:55','اضافة فاتورة مبيعات رقم 1113','1','0',null,'0','1113','sellbillController.php?do=showDetail&sellbillid=1113'); -- id=3962
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3962', '568', '4380', '','0'); -- id=4066
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '935470', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3962', '143', '4380', '','0'); -- id=3964
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12563235', 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 ( '3720', '3720', '2026-10-20', '6', '0', '0', '2026-10-20 13:55:55','اضافة فاتورة مبيعات رقم 1113 - صرف البضاعة من المخزن','1','0',null,'0','1113','sellbillController.php?do=showDetail&sellbillid=1113'); -- id=3963
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3963', '402', '3720', '','0'); -- id=4067
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11625711.81', 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 ('3963', '382', '3720', '','0'); -- id=3965
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23898904.39', 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='3962,0,3963' where sellbillid=1113;
 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-20', 4380, 3720, 3720
                    , 3720, 3720, 3720, 3720
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3720, 3720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4380, sellCostBuyPrice =sellCostBuyPrice+3720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3720
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4380, 3720, 3720
                    , 3720, 3720, 3720, 3720
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3720, 3720, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4380, sellCostBuyPrice =sellCostBuyPrice+3720
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3720, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3720
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3720, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3720
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3720
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3720
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3720
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 4380, 3720, 3720
                    , 3720, 3720, 3720, 3720, 3720, 3720)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4380, netSellCostBuyPrice = netSellCostBuyPrice+3720
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3720
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3720
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3720
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3720
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3720
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3720
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3720;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7439636f20 and sellbillId = 1113 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:25:56";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:55:56", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:55:56', '6', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15329
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:27:37";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:57:37", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:57:37', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15330
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:27:37";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:57:37", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:57:37', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15331
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:27:41";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:57:41", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:57:41', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15332
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:27:46";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:57:46", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:57:46', '3', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15333

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad733d61d2cd
-- ----------------------------------------------------------------------------------------------------

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-20 13:57:46', '06ad733d61d2cd', '1', '0.00', '0', '0', '1', '42390.00', '42390', '42390', '0', '1', '2026-10-20 13:57:46', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '107' ,'0','','','','','-1','0','0','0','0','0','42390','0','','0','0','42390','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1114
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','اضافة فاتورة مبيعات','1114', '0', '2026-10-20 13:57:46', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '42390', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 13:57:46','0','0','',''); -- id=1332
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6549;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01933', '1114', '102', '1933', '9', '430', '3870', '0', '', '0', '2026-10-20 13:57:46', '1933', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6549-9,','1','1','0','0','430','3870','0','','0','0.00','0','0','0','0'); -- id=4437
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 = 4437;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1933, '2026-10-20', 3870, 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+3870, 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-20', 3870, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3870, 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 = '54', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '2950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1933', '1', '9', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '63', '54', '3', '2026-10-20 13:57:46','0','0'); -- id=15270
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6548;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02235', '1114', '102', '2235', '6', '450', '2700', '0', '', '0', '2026-10-20 13:57:46', '2235', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6548-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=4438
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 = 4438;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2235, '2026-10-20', 2700, 2520, 2520
                    , 2520, 2520, 2520, 2520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2700, 2520, 2520
                    , 2520, 2520, 2520, 2520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '3626';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2235', '1', '6', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '15', '3', '2026-10-20 13:57:46','0','0'); -- id=15271
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 332;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01462', '1114', '103', '1462', '6', '430', '2580', '0', '', '0', '2026-10-20 13:57:46', '1462', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','332-6,','1','1','0','0','430','2580','0','','0','0.00','0','0','0','0'); -- id=4439
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 = 4439;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1462, '2026-10-20', 2580, 2460, 2460
                    , 2460, 2460, 2460, 2460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2580, 2460, 2460
                    , 2460, 2460, 2460, 2460
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2460, 2460, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2460
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2460, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2460
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2460, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2460
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2460
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2460
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2460
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '183', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '6', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '189', '183', '3', '2026-10-20 13:57:46','0','0'); -- id=15272
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 1119;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('310','01932', '1114', '102', '1932', '6', '330', '1980', '0', '', '0', '2026-10-20 13:57:46', '1932', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1119-6,','1','1','0','0','330','1980','0','','0','0.00','0','0','0','0'); -- id=4440
UPDATE sellbilldetail SET  lastbuyprice = 310.00 , meanbuyprice = 310.00, lastbuyprice_withDiscount = 310.00, meanbuyprice_withDiscount = 310.00
        , lastbuyprice_withTax = 310, meanbuyprice_withTax = 310, lastbuyprice_withDiscountAndTax = 310
                where sellbilldetailid = 4440;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1932, '2026-10-20', 1980, 1860, 1860
                    , 1860, 1860, 1860, 1860
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1860, 1860, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1860, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1860
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1860, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1860
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1860
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1860
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1860
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1980, 1860, 1860
                    , 1860, 1860, 1860, 1860
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1860, 1860, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1980, sellCostBuyPrice =sellCostBuyPrice+1860
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1860, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1860
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1860, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1860
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1860
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1860
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1860
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '96', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '2949';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1932', '1', '6', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '102', '96', '3', '2026-10-20 13:57:46','0','0'); -- id=15273
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6638;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('460','02237', '1114', '103', '2237', '9', '480', '4320', '0', '', '0', '2026-10-20 13:57:46', '2237', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6638-9,','1','1','0','0','480','4320','0','','0','0.00','0','0','0','0'); -- id=4441
UPDATE sellbilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where sellbilldetailid = 4441;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2237, '2026-10-20', 4320, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+4140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4320, 4140, 4140
                    , 4140, 4140, 4140, 4140
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4140, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+4140
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4140, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4140
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4140, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4140
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4140
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4140
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '54', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '3628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2237', '1', '9', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '63', '54', '3', '2026-10-20 13:57:46','0','0'); -- id=15274
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 571;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('432.4','01708', '1114', '128', '1708', '6', '470', '2820', '0', '', '0', '2026-10-20 13:57:46', '1708', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','571-6,','1','1','0','0','470','2820','0','','0','0.00','0','0','0','0'); -- id=4442
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 432.40, meanbuyprice_withDiscount = 451.20
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 235, lastbuyprice_withDiscountAndTax = 432.4
                where sellbilldetailid = 4442;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1708, '2026-10-20', 2820, 2820, 2820
                    , 2820, 2594.4, 2707.2, 2594.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2820, 1410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2820, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2594.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2707.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2594.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2820, 2820, 2820
                    , 2820, 2594.4, 2707.2, 2594.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2820, 1410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2820, sellCostBuyPrice =sellCostBuyPrice+2820
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2820, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2820
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2594.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2707.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2594.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2820
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 13:57:46' WHERE storedetailid = '2720';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1708', '1', '6', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '6', '0', '3', '2026-10-20 13:57:46','0','0'); -- id=15275
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6548;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02235', '1114', '102', '2235', '3', '450', '1350', '0', '', '0', '2026-10-20 13:57:46', '2235', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6548-3,','1','1','0','0','450','1350','0','','0','0.00','0','0','0','0'); -- id=4443
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 = 4443;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2235, '2026-10-20', 1350, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1350, 1260, 1260
                    , 1260, 1260, 1260, 1260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 1260, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1260
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1260
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 13:57:46' WHERE storedetailid = '3626';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2235', '1', '3', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '12', '3', '2026-10-20 13:57:46','0','0'); -- id=15276
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 75;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','01383', '1114', '94', '1383', '12', '330', '3960', '0', '', '0', '2026-10-20 13:57:46', '1383', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','75-12,','1','1','0','0','330','3960','0','','0','0.00','0','0','0','0'); -- id=4444
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 4444;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1383, '2026-10-20', 3960, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3960, 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+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-20', 3960, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3960, 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 = '270', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '1383';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1383', '1', '12', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '282', '270', '3', '2026-10-20 13:57:46','0','0'); -- id=15277
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 332;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01462', '1114', '103', '1462', '9', '430', '3870', '0', '', '0', '2026-10-20 13:57:46', '1462', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','332-9,','1','1','0','0','430','3870','0','','0','0.00','0','0','0','0'); -- id=4445
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 = 4445;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1462, '2026-10-20', 3870, 3690, 3690
                    , 3690, 3690, 3690, 3690
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3690, 3690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3870, sellCostBuyPrice =sellCostBuyPrice+3690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3690
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3690
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 3870, 3690, 3690
                    , 3690, 3690, 3690, 3690
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3690, 3690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3870, sellCostBuyPrice =sellCostBuyPrice+3690
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3690, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3690
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3690, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3690
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3690
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3690
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3690
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '174', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '9', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '183', '174', '3', '2026-10-20 13:57:46','0','0'); -- id=15278
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 992;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('441.6','01898', '1114', '149', '1898', '6', '480', '2880', '0', '', '0', '2026-10-20 13:57:46', '1898', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','992-6,','1','1','0','0','480','2880','0','','0','0.00','0','0','0','0'); -- id=4446
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 441.60, meanbuyprice_withDiscount = 460.80
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 240, lastbuyprice_withDiscountAndTax = 441.6
                where sellbilldetailid = 4446;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1898, '2026-10-20', 2880, 2880, 2880
                    , 2880, 2649.6, 2764.8, 2649.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2880, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2649.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2764.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2649.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2880
                            , 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-20', 2880, 2880, 2880
                    , 2880, 2649.6, 2764.8, 2649.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2880, 1440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2880, sellCostBuyPrice =sellCostBuyPrice+2880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2649.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2764.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2649.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2880
                            , 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 = '6', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '2915';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1898', '1', '6', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '6', '3', '2026-10-20 13:57:46','0','0'); -- id=15279
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 71;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('270','01379', '1114', '94', '1379', '6', '300', '1800', '0', '', '0', '2026-10-20 13:57:46', '1379', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','71-6,','1','1','0','0','300','1800','0','','0','0.00','0','0','0','0'); -- id=4447
UPDATE sellbilldetail SET  lastbuyprice = 270.00 , meanbuyprice = 270.00, lastbuyprice_withDiscount = 270.00, meanbuyprice_withDiscount = 270.00
        , lastbuyprice_withTax = 270, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 270
                where sellbilldetailid = 4447;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1379, '2026-10-20', 1800, 1620, 1620
                    , 1620, 1620, 1620, 1620
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1620, 1620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1800, 1620, 1620
                    , 1620, 1620, 1620, 1620
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1620, 1620, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1620
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1620, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1620
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1620, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1620
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1620
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1620
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1620
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '296', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '1379';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1379', '1', '6', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '302', '296', '3', '2026-10-20 13:57:46','0','0'); -- id=15280
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6355;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02193', '1114', '94', '2193', '3', '430', '1290', '0', '', '0', '2026-10-20 13:57:46', '2193', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6355-3,','1','1','0','0','430','1290','0','','0','0.00','0','0','0','0'); -- id=4448
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 = 4448;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2193, '2026-10-20', 1290, 1110, 1110
                    , 1110, 1110, 1110, 1110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1110, 1110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1290, sellCostBuyPrice =sellCostBuyPrice+1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1110
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1290, 1110, 1110
                    , 1110, 1110, 1110, 1110
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1110, 1110, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1290, sellCostBuyPrice =sellCostBuyPrice+1110
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1110, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1110
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1110, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1110
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1110
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1110
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1110
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '3561';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2193', '1', '3', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '15', '3', '2026-10-20 13:57:46','0','0'); -- id=15281
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 72;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01380', '1114', '94', '1380', '5', '390', '1950', '0', '', '0', '2026-10-20 13:57:46', '1380', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','72-5,','1','1','0','0','390','1950','0','','0','0.00','0','0','0','0'); -- id=4449
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 = 4449;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1380, '2026-10-20', 1950, 1750, 1750
                    , 1750, 1750, 1750, 1750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1750, 1750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1950, sellCostBuyPrice =sellCostBuyPrice+1750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1950, 1750, 1750
                    , 1750, 1750, 1750, 1750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1750, 1750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1950, sellCostBuyPrice =sellCostBuyPrice+1750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '394', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '1380';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1380', '1', '5', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '399', '394', '3', '2026-10-20 13:57:46','0','0'); -- id=15282
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 982;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('269','01888', '1114', '147', '1888', '15', '300', '4500', '0', '', '0', '2026-10-20 13:57:46', '1888', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','982-15,','1','1','0','0','300','4500','0','','0','0.00','0','0','0','0'); -- id=4450
UPDATE sellbilldetail SET  lastbuyprice = 269.00 , meanbuyprice = 269.00, lastbuyprice_withDiscount = 269.00, meanbuyprice_withDiscount = 269.00
        , lastbuyprice_withTax = 269, meanbuyprice_withTax = 269, lastbuyprice_withDiscountAndTax = 269
                where sellbilldetailid = 4450;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1888, '2026-10-20', 4500, 4035, 4035
                    , 4035, 4035, 4035, 4035
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 4035, 4035, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4500, sellCostBuyPrice =sellCostBuyPrice+4035
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4035
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4035
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4035
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4035
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4035
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (1, '2026-10-20', 4500, 4035, 4035
                    , 4035, 4035, 4035, 4035
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4035, 4035, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4500, sellCostBuyPrice =sellCostBuyPrice+4035
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4035, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4035
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4035, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4035
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4035
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4035
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4035
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '342', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '2905';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1888', '1', '15', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '357', '342', '3', '2026-10-20 13:57:46','0','0'); -- id=15283
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 559;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('386.4','01695', '1114', '127', '1695', '6', '420', '2520', '0', '', '0', '2026-10-20 13:57:46', '1695', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','559-6,','1','1','0','0','420','2520','0','','0','0.00','0','0','0','0'); -- id=4451
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 386.40, meanbuyprice_withDiscount = 386.40
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 420, lastbuyprice_withDiscountAndTax = 386.4
                where sellbilldetailid = 4451;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1695, '2026-10-20', 2520, 2520, 2520
                    , 2520, 2318.4, 2318.4, 2318.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2520, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2318.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2318.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2318.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2520, 2520, 2520
                    , 2520, 2318.4, 2318.4, 2318.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2520, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2318.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2318.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2318.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '126', userid = '3', storedetaildate = '2026-10-20 13:57:46' WHERE storedetailid = '2707';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1695', '1', '6', '1', '1114', 'اضافة فاتورة مبيعات', 'sellbillController.php', '132', '126', '3', '2026-10-20 13:57:46','0','0'); -- id=15284
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6954828.5',  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 ('6912438.5','42390', '0', '2', 'اضافة فاتورة مبيعات', '1114', '6954828.5', '2026-10-20 13:57:46', '3',  'sellbillController.php','1','','0'); -- id=1376
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '42390', '42390', '2026-10-20', '3', '0', '0', '2026-10-20 13:57:46','اضافة فاتورة مبيعات رقم 1114','1','0',null,'0','1114','sellbillController.php?do=showDetail&sellbillid=1114'); -- id=3964
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3964', '419', '42390', '','0'); -- id=4068
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6954828', 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 ('3964', '143', '42390', '','0'); -- id=3966
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12605625', 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 ( '39207.4', '39207.4', '2026-10-20', '3', '0', '0', '2026-10-20 13:57:46','اضافة فاتورة مبيعات رقم 1114 - صرف البضاعة من المخزن','1','0',null,'0','1114','sellbillController.php?do=showDetail&sellbillid=1114'); -- id=3965
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3965', '402', '39207.4', '','0'); -- id=4069
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11664919.21', 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 ('3965', '382', '39207.4', '','0'); -- id=3967
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23859696.99', 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='3964,0,3965' where sellbillid=1114;
 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-20', 42390, 39865, 39865
                    , 39865, 39207.4, 39435.4, 39207.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,39865, 37015, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+42390, sellCostBuyPrice =sellCostBuyPrice+39865
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+39865, sellCostMeanBuyPrice = sellCostMeanBuyPrice+39865
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+39207.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+39435.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+39207.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+39865
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+37015
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 42390, 39865, 39865
                    , 39865, 39207.4, 39435.4, 39207.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,39865, 37015, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+42390, sellCostBuyPrice =sellCostBuyPrice+39865
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+39865, sellCostMeanBuyPrice = sellCostMeanBuyPrice+39865
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+39207.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+39435.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+39207.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+39865
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+37015
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 42390, 39865, 39865
                    , 39865, 39207.4, 39435.4, 39207.4, 39865, 37015)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+42390, netSellCostBuyPrice = netSellCostBuyPrice+39865
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+39865
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+39865
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+39207.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+39435.4
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+39207.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+39865
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+37015;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad733d61d2cd and sellbillId = 1114 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:27:46";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:57:46", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:57:46', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15334
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:28:41";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 13:58:41", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 13:58:41', '4', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15335
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:30:06";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:00:06", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 14:00:06', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15336
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-20 10:30:14";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 14:00:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 14:00:14', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15337
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:30:14";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:00:14", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 14:00:14', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15338
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-20 10:30:24";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 14:00:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 14:00:24', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15339
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:30:28";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:00:28", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 14:00:28', '2', '', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15340
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-20 10:30:29";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 14:00:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 14:00:29', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15341
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:30:31";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:00:31", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:00:31', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15342
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:30:44";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:00:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:00:44', '2', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15343

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad744563381d
-- ----------------------------------------------------------------------------------------------------

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-20 14:00:44', '06ad744563381d', '1', '0.00', '0', '0', '1', '15690.00', '15690', '15690', '0', '1', '2026-10-20 14:00:44', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '39' ,'0','','','','','-1','0','0','0','0','0','15690','0','','0','0','15690','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1115
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','اضافة فاتورة مبيعات','1115', '0', '2026-10-20 14:00:44', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '15690', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 14:00:44','0','0','',''); -- id=1333
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('365','09666', '1115', '30', '976', '10', '385', '3850', '0', '', '0', '2026-10-20 14:00:44', '976', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','385','3850','0','','0','0.00','0','0','0','0'); -- id=4452
UPDATE sellbilldetail SET  lastbuyprice = 365.00 , meanbuyprice = 365.00, lastbuyprice_withDiscount = 365.00, meanbuyprice_withDiscount = 365.00
        , lastbuyprice_withTax = 365, meanbuyprice_withTax = 365, lastbuyprice_withDiscountAndTax = 365
                where sellbilldetailid = 4452;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (976, '2026-10-20', 3850, 3650, 3650
                    , 3650, 3650, 3650, 3650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 3650, 3650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 3850, 3650, 3650
                    , 3650, 3650, 3650, 3650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3650, 3650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3850, sellCostBuyPrice =sellCostBuyPrice+3650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '65', userid = '2', storedetaildate = '2026-10-20 14:00:44' WHERE storedetailid = '976';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('976', '1', '10', '1', '1115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '75', '65', '2', '2026-10-20 14:00:44','0','0'); -- id=15285
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 6621;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('340','78054', '1115', '33', '1041', '5', '360', '1800', '0', '', '0', '2026-10-20 14:00:44', '1041', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6621-5,','1','1','0','0','360','1800','0','','0','0.00','0','0','0','0'); -- id=4453
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 340.00, meanbuyprice_withDiscount = 340.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 340
                where sellbilldetailid = 4453;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1041, '2026-10-20', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1800, 1700, 1700
                    , 1700, 1700, 1700, 1700
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1700, 1700, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1800, sellCostBuyPrice =sellCostBuyPrice+1700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1700, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1700
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1700
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1700
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '90', userid = '2', storedetaildate = '2026-10-20 14:00:44' WHERE storedetailid = '1041';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1041', '1', '5', '1', '1115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '95', '90', '2', '2026-10-20 14:00:44','0','0'); -- id=15286
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','09457', '1115', '25', '898', '5', '400', '2000', '0', '', '0', '2026-10-20 14:00:44', '898', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','400','2000','0','','0','0.00','0','0','0','0'); -- id=4454
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 = 4454;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (898, '2026-10-20', 2000, 1900, 1900
                    , 1900, 1900, 1900, 1900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1900, 1900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+1900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-20', 2000, 1900, 1900
                    , 1900, 1900, 1900, 1900
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1900, 1900, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2000, sellCostBuyPrice =sellCostBuyPrice+1900
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1900, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1900
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1900, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1900
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1900
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1900
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1900
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '10', userid = '2', storedetaildate = '2026-10-20 14:00:44' WHERE storedetailid = '898';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('898', '1', '5', '1', '1115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '2', '2026-10-20 14:00:44','0','0'); -- id=15287
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','08757', '1115', '26', '902', '5', '450', '2250', '0', '', '0', '2026-10-20 14:00:44', '902', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','450','2250','0','','0','0.00','0','0','0','0'); -- id=4455
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 4455;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (902, '2026-10-20', 2250, 2150, 2150
                    , 2150, 2150, 2150, 2150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2150, 2150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2250, sellCostBuyPrice =sellCostBuyPrice+2150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2250, 2150, 2150
                    , 2150, 2150, 2150, 2150
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2150, 2150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2250, sellCostBuyPrice =sellCostBuyPrice+2150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2150, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2150
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2150
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-20 14:00:44' WHERE storedetailid = '902';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('902', '1', '5', '1', '1115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '45', '40', '2', '2026-10-20 14:00:44','0','0'); -- id=15288
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','09820', '1115', '8', '761', '5', '540', '2700', '0', '', '0', '2026-10-20 14:00:44', '761', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','540','2700','0','','0','0.00','0','0','0','0'); -- id=4456
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 = 4456;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (761, '2026-10-20', 2700, 2600, 2600
                    , 2600, 2600, 2600, 2600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2600, 2600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2700, 2600, 2600
                    , 2600, 2600, 2600, 2600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2600, 2600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '5', userid = '2', storedetaildate = '2026-10-20 14:00:44' WHERE storedetailid = '761';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('761', '1', '5', '1', '1115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '10', '5', '2', '2026-10-20 14:00:44','0','0'); -- id=15289
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 573;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('358.8','01710', '1115', '128', '1710', '3', '390', '1170', '0', '', '0', '2026-10-20 14:00:44', '1710', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','573-3,','1','1','0','0','390','1170','0','','0','0.00','0','0','0','0'); -- id=4457
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 358.80, meanbuyprice_withDiscount = 374.40
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 195, lastbuyprice_withDiscountAndTax = 358.8
                where sellbilldetailid = 4457;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1710, '2026-10-20', 1170, 1170, 1170
                    , 1170, 1076.4, 1123.2, 1076.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1170, 585, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1170, sellCostBuyPrice =sellCostBuyPrice+1170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1076.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1123.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1076.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+585
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1170, 1170, 1170
                    , 1170, 1076.4, 1123.2, 1076.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1170, 585, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1170, sellCostBuyPrice =sellCostBuyPrice+1170
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1170, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1170
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1076.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1123.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1076.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1170
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+585
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2026-10-20 14:00:44' WHERE storedetailid = '2722';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1710', '1', '3', '1', '1115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '6', '2', '2026-10-20 14:00:44','0','0'); -- id=15290
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 953;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','01458', '1115', '103', '1458', '6', '320', '1920', '0', '', '0', '2026-10-20 14:00:44', '1458', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','953-6,','1','1','0','0','320','1920','0','','0','0.00','0','0','0','0'); -- id=4458
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 4458;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1458, '2026-10-20', 1920, 1800, 1800
                    , 1800, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1800, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1920, sellCostBuyPrice =sellCostBuyPrice+1800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1920, 1800, 1800
                    , 1800, 1800, 1800, 1800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1800, 1800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1920, sellCostBuyPrice =sellCostBuyPrice+1800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '2', storedetaildate = '2026-10-20 14:00:44' WHERE storedetailid = '1483';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1458', '1', '6', '1', '1115', 'اضافة فاتورة مبيعات', 'sellbillController.php', '66', '60', '2', '2026-10-20 14:00:44','0','0'); -- id=15291
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6970518.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6954828.5','15690', '0', '2', 'اضافة فاتورة مبيعات', '1115', '6970518.5', '2026-10-20 14:00:44', '2',  'sellbillController.php','1','','0'); -- id=1377
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '15690', '15690', '2026-10-20', '2', '0', '0', '2026-10-20 14:00:44','اضافة فاتورة مبيعات رقم 1115','1','0',null,'0','1115','sellbillController.php?do=showDetail&sellbillid=1115'); -- id=3966
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3966', '419', '15690', '','0'); -- id=4070
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6970518', 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 ('3966', '143', '15690', '','0'); -- id=3968
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12621315', 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 ( '14876.4', '14876.4', '2026-10-20', '2', '0', '0', '2026-10-20 14:00:44','اضافة فاتورة مبيعات رقم 1115 - صرف البضاعة من المخزن','1','0',null,'0','1115','sellbillController.php?do=showDetail&sellbillid=1115'); -- id=3967
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3967', '402', '14876.4', '','0'); -- id=4071
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11679795.61', 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 ('3967', '382', '14876.4', '','0'); -- id=3969
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23844820.59', 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='3966,0,3967' where sellbillid=1115;
 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-20', 15690, 14970, 14970
                    , 14970, 14876.4, 14923.2, 14876.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,14970, 14385, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15690, sellCostBuyPrice =sellCostBuyPrice+14970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+14876.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+14923.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+14876.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14385
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 15690, 14970, 14970
                    , 14970, 14876.4, 14923.2, 14876.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,14970, 14385, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+15690, sellCostBuyPrice =sellCostBuyPrice+14970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+14970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+14970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+14876.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+14923.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+14876.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+14970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+14385
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 15690, 14970, 14970
                    , 14970, 14876.4, 14923.2, 14876.4, 14970, 14385)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+15690, netSellCostBuyPrice = netSellCostBuyPrice+14970
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+14970
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+14970
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+14876.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+14923.2
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+14876.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+14970
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+14385;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad744563381d and sellbillId = 1115 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:30:44";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:00:44", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:00:44', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15344
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:31:58";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:01:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:01:58', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15345
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:32:04";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:02:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:02:04', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15346
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:33:23";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:03:23", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:03:23', '6', 'showDetail', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1113'); -- id=15347
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:33:52";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:03:52", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:03:52', '2', 'showDetail', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1115'); -- id=15348
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:34:01";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:04:01", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:04:01', '2', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15349
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:38:50";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:08:50", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:08:50', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15350
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:38:50";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:08:50", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:08:50', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15351
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:38:51";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:08:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 14:08:51', '1', 'oneSupplier', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15352
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:38:59";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:08:59", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:08:59', '3', 'addAndRetuen', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15353

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7492aa9ee8
-- ----------------------------------------------------------------------------------------------------

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-20 14:08:59', '06ad7492aa9ee8', '1', '0.00', '0', '0', '1', '5175.00', '5175', '5175', '0', '1', '2026-10-20 14:08:59', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '10' ,'0','','','','','-1','0','0','0','0','0','5175','0','','0','0','5175','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1116
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','اضافة فاتورة مبيعات','1116', '0', '2026-10-20 14:08:59', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '5175', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 14:08:59','0','0','',''); -- id=1334
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 373;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('457','01555', '1116', '8', '1555', '5', '485', '2425', '0', '', '0', '2026-10-20 14:08:59', '1555', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','373-5,','1','1','0','0','485','2425','0','','0','0.00','0','0','0','0'); -- id=4459
UPDATE sellbilldetail SET  lastbuyprice = 457.00 , meanbuyprice = 457.00, lastbuyprice_withDiscount = 457.00, meanbuyprice_withDiscount = 457.00
        , lastbuyprice_withTax = 457, meanbuyprice_withTax = 457, lastbuyprice_withDiscountAndTax = 457
                where sellbilldetailid = 4459;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1555, '2026-10-20', 2425, 2285, 2285
                    , 2285, 2285, 2285, 2285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2285, 2285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2425, sellCostBuyPrice =sellCostBuyPrice+2285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2425, 2285, 2285
                    , 2285, 2285, 2285, 2285
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2285, 2285, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2425, sellCostBuyPrice =sellCostBuyPrice+2285
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2285, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2285
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2285, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2285
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2285
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2285
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2285
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '3', storedetaildate = '2026-10-20 14:08:59' WHERE storedetailid = '1580';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1555', '1', '5', '1', '1116', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '10', '3', '2026-10-20 14:08:59','0','0'); -- id=15292
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+5 where id = 1161;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('530','01969', '1116', '28', '1969', '5', '550', '2750', '0', '', '0', '2026-10-20 14:08:59', '1969', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1161-5,','1','1','0','0','550','2750','0','','0','0.00','0','0','0','0'); -- id=4460
UPDATE sellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where sellbilldetailid = 4460;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1969, '2026-10-20', 2750, 2650, 2650
                    , 2650, 2650, 2650, 2650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2650, 2650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2750, 2650, 2650
                    , 2650, 2650, 2650, 2650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2650, 2650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2750, sellCostBuyPrice =sellCostBuyPrice+2650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 14:08:59' WHERE storedetailid = '2986';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1969', '1', '5', '1', '1116', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '3', '2026-10-20 14:08:59','0','0'); -- id=15293
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6975693.5',  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 ('6970518.5','5175', '0', '2', 'اضافة فاتورة مبيعات', '1116', '6975693.5', '2026-10-20 14:08:59', '3',  'sellbillController.php','1','','0'); -- id=1378
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '5175', '5175', '2026-10-20', '3', '0', '0', '2026-10-20 14:08:59','اضافة فاتورة مبيعات رقم 1116','1','0',null,'0','1116','sellbillController.php?do=showDetail&sellbillid=1116'); -- id=3968
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3968', '419', '5175', '','0'); -- id=4072
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6975693', 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 ('3968', '143', '5175', '','0'); -- id=3970
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12626490', 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 ( '4935', '4935', '2026-10-20', '3', '0', '0', '2026-10-20 14:08:59','اضافة فاتورة مبيعات رقم 1116 - صرف البضاعة من المخزن','1','0',null,'0','1116','sellbillController.php?do=showDetail&sellbillid=1116'); -- id=3969
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3969', '402', '4935', '','0'); -- id=4073
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11684730.61', 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 ('3969', '382', '4935', '','0'); -- id=3971
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23839885.59', 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='3968,0,3969' where sellbillid=1116;
 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-20', 5175, 4935, 4935
                    , 4935, 4935, 4935, 4935
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4935, 4935, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5175, sellCostBuyPrice =sellCostBuyPrice+4935
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4935, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4935
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4935, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4935
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4935
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4935
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4935
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 5175, 4935, 4935
                    , 4935, 4935, 4935, 4935
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4935, 4935, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5175, sellCostBuyPrice =sellCostBuyPrice+4935
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4935, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4935
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4935, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4935
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4935
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4935
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4935
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 5175, 4935, 4935
                    , 4935, 4935, 4935, 4935, 4935, 4935)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+5175, netSellCostBuyPrice = netSellCostBuyPrice+4935
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4935
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4935
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4935
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4935
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4935
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4935
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4935;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7492aa9ee8 and sellbillId = 1116 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:39:00";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:09:00", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:09:00', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15354
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:41:30";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:11:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:11:30', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15355
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:41:36";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:11:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:11:36', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15356
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:41:40";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:11:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:11:40', '1', 'editbill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=150'); -- id=15357
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:41:49";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:11:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:11:49', '1', 'update', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=15358
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 150;
UPDATE buybill SET  buybillsysdate = '2026-10-20 14:11:49', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '150';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-13 17:57:39', 1, 1911, 0, 0
                    , 525, 30, 0, 0, 1, '2026-10-20 14:11:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 14:11:49' ; -- id=1062
UPDATE buybilldetail SET  lastbuyprice = 525.00 , meanbuyprice = 525.00, lastbuyprice_withDiscount = 525.00, meanbuyprice_withDiscount = 525.00
        , lastbuyprice_withTax = 525.00, meanbuyprice_withTax = 262.50, lastbuyprice_withDiscountAndTax = 525.00
                where buybilldetailid = 924;
UPDATE product SET productName = 'اوفر سايز او ار ', productDescription = '', productCatId = '143', productBuyPrice = '525.00', productSellAllPrice = '585.00', productSellUnitPrice = '585.00', productSellHalfPrice = '585.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01911',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '525',lastbuyprice_withDiscount = '0',meanbuyprice = '525',meanbuyprice_withDiscount = '525' , productbuypricereal = '525.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.43' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='525',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='525',meanbuyprice_withTax='918.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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1911';
UPDATE productunit SET proUnitBuyPrice  = 525 * productnumber WHERE productid = 1911;
UPDATE storedetail SET  productquantity = '-12', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2928';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1911', '1', '30', '1', '150', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '18', '-12', '1', '2026-10-13 17:57:39','0','0'); -- id=15294
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-13 17:57:39', 1, 1912, 0, 0
                    , 540, 48, 0, 0, 1, '2026-10-20 14:11:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-48, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 14:11:49' ; -- id=1063
UPDATE buybilldetail SET  lastbuyprice = 540.00 , meanbuyprice = 540.00, lastbuyprice_withDiscount = 540.00, meanbuyprice_withDiscount = 540.00
        , lastbuyprice_withTax = 540.00, meanbuyprice_withTax = 270.00, lastbuyprice_withDiscountAndTax = 540.00
                where buybilldetailid = 925;
UPDATE product SET productName = 'بوكس فيت استرس او ار ', productDescription = '', productCatId = '143', productBuyPrice = '540.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01912',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '540',lastbuyprice_withDiscount = '0',meanbuyprice = '540.00',meanbuyprice_withDiscount = '540' , productbuypricereal = '540.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='540',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='540',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1912';
UPDATE productunit SET proUnitBuyPrice  = 540 * productnumber WHERE productid = 1912;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2929';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1912', '1', '48', '1', '150', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '48', '0', '1', '2026-10-13 17:57:39','0','0'); -- id=15295
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-13 17:57:39', 1, 1913, 0, 0
                    , 580, 42, 0, 0, 1, '2026-10-20 14:11:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-42, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 14:11:49' ; -- id=1064
UPDATE buybilldetail SET  lastbuyprice = 580.00 , meanbuyprice = 580.00, lastbuyprice_withDiscount = 580.00, meanbuyprice_withDiscount = 580.00
        , lastbuyprice_withTax = 580.00, meanbuyprice_withTax = 290.00, lastbuyprice_withDiscountAndTax = 580.00
                where buybilldetailid = 926;
UPDATE product SET productName = 'بوكس فيت سمايل او ار ', productDescription = '', productCatId = '143', productBuyPrice = '580.00', productSellAllPrice = '640.00', productSellUnitPrice = '640.00', productSellHalfPrice = '640.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01913',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '0',meanbuyprice = '580.00',meanbuyprice_withDiscount = '580' , productbuypricereal = '580.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.34' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='580',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='580',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1913';
UPDATE productunit SET proUnitBuyPrice  = 580 * productnumber WHERE productid = 1913;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2930';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1913', '1', '42', '1', '150', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '42', '0', '1', '2026-10-13 17:57:39','0','0'); -- id=15296
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-13 17:57:39', 1, 1914, 0, 0
                    , 450, 48, 0, 0, 1, '2026-10-20 14:11:49')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-48, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 14:11:49' ; -- id=1065
UPDATE buybilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450.00, meanbuyprice_withTax = 225.00, lastbuyprice_withDiscountAndTax = 450.00
                where buybilldetailid = 927;
UPDATE product SET productName = 'اوفر سايز اوربجنال او ار ', productDescription = '', productCatId = '143', productBuyPrice = '450.00', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01914',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '0',meanbuyprice = '450.00',meanbuyprice_withDiscount = '450' , productbuypricereal = '450.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '13.33' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='450',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1914';
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 1914;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2931';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1914', '1', '48', '1', '150', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '48', '0', '1', '2026-10-13 17:57:39','0','0'); -- id=15297
UPDATE supplier SET  suppliercurrentDebt = '-50000',suppliercurrentDebtInCurrency= '-50000' , userid = '1', supplierdate = '2026-10-20 14:11:49'   WHERE supplierid = '142';
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 ('142', '37630.00', '87630.00', '1', 'حذف فاتورة مشتريات - للتعديل', '150', '-50000', '2026-10-13 17:57:39', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','87630','1','37630','87630','-50000','0',''); -- id=753
UPDATE productserial SET del = 1
		 WHERE billid = 150;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06ace46e3062b5', '2026-10-13 17:57:39', '142', '-50000.00', '35890', '0', '0', '85890.00', '85890.00', '0.00', '85890', '1', '2026-10-20 14:11:49', '', '1', '0', '', '1', '1','1','150','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=266
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 ('01911', '266', '143', '1911', '30.00', '525', '15750.00', '0.00', '', '2026-10-20 14:11:49', '1911','','','0','0','0','0','0',null,'525','15750','0','0','0','0','0','0','0','0','1'); -- id=1486
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-13 17:57:39', 1, 1911, 0, 0
                    , 525, 30, 0, 0, 1, '2026-10-20 14:11:49')
                ON DUPLICATE KEY UPDATE buyprice = 525,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 14:11:49' ; -- id=1062
UPDATE product SET  productBuyPrice = "525" WHERE productId = 1911 ;
UPDATE buybilldetail SET  quantitybefore = -12 WHERE buybilldetailid = 1486 ;
UPDATE product SET productName = 'اوفر سايز او ار ', productDescription = '', productCatId = '143', productBuyPrice = '525.00', productSellAllPrice = '585.00', productSellUnitPrice = '585.00', productSellHalfPrice = '585.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01911',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '525',lastbuyprice_withDiscount = '525',meanbuyprice = '525',meanbuyprice_withDiscount = '525' , productbuypricereal = '525.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '11.43' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='525',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='525',meanbuyprice_withTax='672.66',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='525',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1911';
UPDATE buybilldetail SET  lastbuyprice = 525 , meanbuyprice = 525, lastbuyprice_withDiscount = 525, meanbuyprice_withDiscount = 525
        , lastbuyprice_withTax = 525, meanbuyprice_withTax = 672.66, lastbuyprice_withDiscountAndTax = 525
                where buybilldetailid = 1486;
UPDATE productunit SET proUnitBuyPrice  = 525 * productnumber WHERE productid = 1911;
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2928';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1911', '1', '30', '0', '266', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-12', '18', '1', '2026-10-13 17:57:39','0','0'); -- id=15298
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 ('01912', '266', '143', '1912', '48.00', '540', '25920.00', '0.00', '', '2026-10-20 14:11:49', '1912','','','0','0','0','0','0',null,'540','25920','0','0','0','0','0','0','0','0','1'); -- id=1487
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-13 17:57:39', 1, 1912, 0, 0
                    , 540, 48, 0, 0, 1, '2026-10-20 14:11:49')
                ON DUPLICATE KEY UPDATE buyprice = 540,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 14:11:49' ; -- id=1063
UPDATE product SET  productBuyPrice = "540" WHERE productId = 1912 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1487 ;
UPDATE product SET productName = 'بوكس فيت استرس او ار ', productDescription = '', productCatId = '143', productBuyPrice = '540.00', productSellAllPrice = '600.00', productSellUnitPrice = '600.00', productSellHalfPrice = '600.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01912',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '540',lastbuyprice_withDiscount = '540',meanbuyprice = '540',meanbuyprice_withDiscount = '540' , productbuypricereal = '540.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='540',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='540',meanbuyprice_withTax='270',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='540',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1912';
UPDATE buybilldetail SET  lastbuyprice = 540 , meanbuyprice = 540, lastbuyprice_withDiscount = 540, meanbuyprice_withDiscount = 540
        , lastbuyprice_withTax = 540, meanbuyprice_withTax = 270, lastbuyprice_withDiscountAndTax = 540
                where buybilldetailid = 1487;
UPDATE productunit SET proUnitBuyPrice  = 540 * productnumber WHERE productid = 1912;
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2929';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1912', '1', '48', '0', '266', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '48', '1', '2026-10-13 17:57:39','0','0'); -- id=15299
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 ('01913', '266', '143', '1913', '39', '580', '22620.00', '0.00', '', '2026-10-20 14:11:49', '1913','','','0','0','0','0','0',null,'580','22620','0','0','0','0','0','0','0','0','1'); -- id=1488
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-13 17:57:39', 1, 1913, 0, 0
                    , 580, 39, 0, 0, 1, '2026-10-20 14:11:49')
                ON DUPLICATE KEY UPDATE buyprice = 580,
                        buyQuantity =buyQuantity+39, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 14:11:49' ; -- id=1064
UPDATE product SET  productBuyPrice = "580" WHERE productId = 1913 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1488 ;
UPDATE product SET productName = 'بوكس فيت سمايل او ار ', productDescription = '', productCatId = '143', productBuyPrice = '580.00', productSellAllPrice = '640.00', productSellUnitPrice = '640.00', productSellHalfPrice = '640.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01913',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '580',lastbuyprice_withDiscount = '580',meanbuyprice = '580',meanbuyprice_withDiscount = '580' , productbuypricereal = '580.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.34' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='580',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='580',meanbuyprice_withTax='279.26',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='580',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1913';
UPDATE buybilldetail SET  lastbuyprice = 580 , meanbuyprice = 580, lastbuyprice_withDiscount = 580, meanbuyprice_withDiscount = 580
        , lastbuyprice_withTax = 580, meanbuyprice_withTax = 279.26, lastbuyprice_withDiscountAndTax = 580
                where buybilldetailid = 1488;
UPDATE productunit SET proUnitBuyPrice  = 580 * productnumber WHERE productid = 1913;
UPDATE storedetail SET  productquantity = '39', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2930';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1913', '1', '39', '0', '266', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '39', '1', '2026-10-13 17:57:39','0','0'); -- id=15300
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 ('01914', '266', '143', '1914', '48.00', '450', '21600.00', '0.00', '', '2026-10-20 14:11:49', '1914','','','0','0','0','0','0',null,'450','21600','0','0','0','0','0','0','0','0','1'); -- id=1489
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-13 17:57:39', 1, 1914, 0, 0
                    , 450, 48, 0, 0, 1, '2026-10-20 14:11:49')
                ON DUPLICATE KEY UPDATE buyprice = 450,
                        buyQuantity =buyQuantity+48, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 14:11:49' ; -- id=1065
UPDATE product SET  productBuyPrice = "450" WHERE productId = 1914 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1489 ;
UPDATE product SET productName = 'اوفر سايز اوربجنال او ار ', productDescription = '', productCatId = '143', productBuyPrice = '450.00', productSellAllPrice = '510.00', productSellUnitPrice = '510.00', productSellHalfPrice = '510.00', productDate = '2026-10-13', conditions = '0', userId = '1', limitamount = '0', parcode = '01914',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '450',lastbuyprice_withDiscount = '450',meanbuyprice = '450',meanbuyprice_withDiscount = '450' , productbuypricereal = '450.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '13.33' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='450',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='450',meanbuyprice_withTax='225',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='450',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1914';
UPDATE buybilldetail SET  lastbuyprice = 450 , meanbuyprice = 450, lastbuyprice_withDiscount = 450, meanbuyprice_withDiscount = 450
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 450
                where buybilldetailid = 1489;
UPDATE productunit SET proUnitBuyPrice  = 450 * productnumber WHERE productid = 1914;
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2931';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1914', '1', '48', '0', '266', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '48', '1', '2026-10-13 17:57:39','0','0'); -- id=15301
DELETE FROM productserial WHERE billid = 150
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '35890',suppliercurrentDebtInCurrency= '35890' , userid = '1', supplierdate = '2026-10-20 14:11:49'   WHERE supplierid = '142';
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 ('142', '-50000.00', '85890', '0', 'اضافة فاتورة مشتريات', '266', '35890', '2026-10-20 14:11:49', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','87630','1','-50000','85890','35890','0',''); -- id=754
UPDATE dailyentry SET totalcreditor = '87630.00', totaldebtor = '87630.00', thedate = '2026-10-14', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-14 17:10:18', entryComment = 'اضافة فاتورة مشتريات رقم 150', fromFlag = '1',related='0',isopeningentry='0',operationId='150',operationDetailLink='buyBillController.php?do=details&id=150' WHERE id = '2420';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '87630.00', '87630.00', '2026-10-20', '1', '0', '2420', '2026-10-20 14:11:50','تم عكس القيد رقم 2420 ','1','0','0','0','0',''); -- id=3970
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3970', '382', '87630.00', '','0'); -- id=3972
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23752255.59', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3970', '625', '87630.00', '','0'); -- id=4074
UPDATE accountstree SET name = 'اوريجنال - مورد', customName = 'اوريجنال - مورد', customNameEn = 'اوريجنال - مورد', nameEn = 'اوريجنال - مورد', parent = '81', accountNature = '1', theValue = '-50000', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:19:02' WHERE id = '625';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '85890', '85890', '2026-10-20', '1', '0', '0', '2026-10-20 14:11:50','اضافة فاتورة مشتريات رقم 266','1','0',null,'0','266','buyBillController.php?do=details&id=266'); -- id=3971
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3971', '382', '85890', '','0'); -- id=4075
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23838145.59', 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 ('3971', '625', '85890', '','0'); -- id=3973
UPDATE accountstree SET name = 'اوريجنال - مورد', customName = 'اوريجنال - مورد', customNameEn = 'اوريجنال - مورد', nameEn = 'اوريجنال - مورد', parent = '81', accountNature = '1', theValue = '35890', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:19:02' WHERE id = '625';
update buybill set dailyentryid='3971,0' where buybillid=266;
UPDATE product SET overAllAveragePrice = 525 WHERE productId = 1911;UPDATE product SET overAllAveragePrice = 540 WHERE productId = 1912;UPDATE product SET overAllAveragePrice = 580 WHERE productId = 1913;UPDATE product SET overAllAveragePrice = 450 WHERE productId = 1914;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:41:50";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:11:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:11:50', '1', 'editprint', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=266'); -- id=15359
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:42:44";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:12:44", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:12:44', '3', 'showDetail', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1116'); -- id=15360
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:46:42";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:16:42", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:16:42', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15361
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:48:14";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:18:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:18:14', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15362
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:48:21";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:18:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:18:21', '1', 'show', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15363
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:48:23";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:18:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:18:23', '1', 'editbill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=157'); -- id=15364
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 10:50:40";
UPDATE user SET loginip = "156.196.58.49", lastactivetime = "2026-10-20 14:20:40", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:20:40', '3', 'addsellBill', '156.196.58.49', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15365
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-20 11:05:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:35:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 14:35:29', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15366
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-20 11:05:29";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 14:35:29", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 14:35:29', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15367
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:05:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:35:30", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 14:35:30', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15368
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-20 11:05:30";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 14:35:30', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15369
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:05:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:35:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:35:32', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15370
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:05:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:35:35", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:35:35', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15371
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:05:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:35:35", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:35:35', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15372
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:06:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:36:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:36:07', '3', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15373

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad752074fbf1
-- ----------------------------------------------------------------------------------------------------

BEGIN;
INSERT INTO returnsellbill (returnsellbilldate, returnsellbillserial, returnsellbillclientid, returnsellbilltotaldeptbefor, returnsellbilltotaldeptafter, returnsellbilldiscount, returnsellbilldiscounttype, returnsellbilltotalbill, returnsellbillaftertotalbill, returnsellbilltotalpayed, returnsellbillfinalbill, returnsellbillstoreid, returnsellbillsysdate,comment, userid, conditions, returnsellbillclientname, returnsellbillsaveid, returnsellbildirectpayment, billnameid, sellerid, tempclientName, returnsellQuantity,tax, carnumber, cartype, carchase, carmotor,costcenterid,dailyentryid,delbyuserid,billReservation,billReservationDate,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,autoSaveFlag,obgyBillType,billoperationid,obygyVisitId,pricetype,currencyId,sellbillno,returnsellbilltypeclientid) VALUES ('2026-10-20 14:36:07', '06ad752074fbf1', '1', '0.00', '0', '0', '1', '2750', '2750', '-2750', '0', '1', '2026-10-20 14:36:07', '', '3', '0', 'نقدي','2', '0', '5', '0', 'نقدي', '5', '0', '', '','','','-1','0','0','0','','0','-2750','0','0','0','0','0','0','0','0','-1','0','0','1','','0'); -- id=37
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','1','اضافة فاتورة مردوات مبيعات','37', '0', '2026-10-20 14:36:07', '3', 'returnsellbillController.php', 'اضافة فاتورة مردوات مبيعات', '2750', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 14:36:07','0','0','',''); -- id=1335
INSERT INTO returnsellbilldetail (buyprice, parcode, returnsellbillid, returnsellbilldetailcatid, returnsellbilldetailproductid, returnsellbilldetailquantity, returnsellbilldetailprice, returnsellbilldetailtotalprice, conditions, note, pricetype, discountvalue, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,pricetypepro,proHeight,proWidth,soldSerialsInDetails,lastbuyprice_withTax,meanbuyprice_withTax,returnsellbilldetailpriceC,returnsellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,lastbuyprice_withDiscountAndTax) VALUES ('530.00', '01969', '37', '28', '1969', '5', '550', '2750', '0', '', '0', '0', '1969', '0.00', '0','1','0','','','0','0','0','0','0','0','1','1','','0','0','550','2750','0','','0'); -- id=55
UPDATE returnsellbilldetail SET  lastbuyprice = 530.00 , meanbuyprice = 530.00, lastbuyprice_withDiscount = 530.00, meanbuyprice_withDiscount = 530.00
        , lastbuyprice_withTax = 530, meanbuyprice_withTax = 530, lastbuyprice_withDiscountAndTax = 530
                where returnsellbilldetailid = 55;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1969, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2750, 2650, 2650, 2650
                    , 2650, 2650, 2650, 0, 5, 0, 0, 2650, 2650)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+2750, returnSellCostBuyPrice = returnSellCostBuyPrice+2650, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2650
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2650, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2650
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2650
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2650
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2650
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2650
                        , netQuantity = netQuantity+0
                        , netQuantityRet = netQuantityRet+5;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2750, 2650, 2650, 2650
                    , 2650, 2650, 2650, 0, 0, 2650, 2650)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+2750, returnSellCostBuyPrice = returnSellCostBuyPrice+2650, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2650
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2650, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2650
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2650
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2650
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2650
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2650;
UPDATE storedetail SET  productquantity = '5', userid = '3', storedetaildate = '2026-10-20 14:36:07' WHERE storedetailid = '2986';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1969', '1', '5', '0', '37', 'اضافة فاتورة مردودات مبيعات', 'returnsellbillController.php', '0', '5', '3', '2026-10-20 14:36:07','0','0'); -- id=15302
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6972943.5',  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 ('6975693.5','-2750', '1', '2', 'اضافة فاتورة مردوات مبيعات', '37', '6972943.5', '2026-10-20 14:36:07', '3',  'returnsellbillController.php','1','','0'); -- id=1379
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2750', '2750', '2026-10-20', '3', '0', '0', '2026-10-20 14:36:07','اضافة فاتورة مردود مبيعات رقم 37','1','0',null,'0','37','returnsellbillController.php?do=showDetail&returnsellbillid=37'); -- id=3972
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3972', '143', '2750', '','0'); -- id=4076
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12623740', 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 dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3972', '419', '2750', '','0'); -- id=3974
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6972943', 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 dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2650', '2650', '2026-10-20', '3', '0', '0', '2026-10-20 14:36:07','اضافة فاتورة مردود مبيعات رقم 37 - صرف البضاعة من المخزن','1','0',null,'0','37','returnsellbillController.php?do=showDetail&returnsellbillid=37'); -- id=3973
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3973', '382', '2650', '','0'); -- id=4077
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23840795.59', 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 ('3973', '402', '2650', '','0'); -- id=3975
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11682080.61', 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';
update returnsellbill set dailyentryid='3972,0,3973' where returnsellbillid=37;
 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-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2750, 2650, 2650, 2650
                    , 2650, 2650, 2650 ,0, 0, 2650, 2650)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+2750, returnSellCostBuyPrice = returnSellCostBuyPrice+2650, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2650
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2650, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2650
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2650
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2650
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2650
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2650;
 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-20', 0, 0, 0
                    , 0, 0, 0, 0
                    , 2750, 2650, 2650, 2650
                    , 2650, 2650, 2650 ,0, 0, 2650, 2650)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+0, sellCostBuyPrice =sellCostBuyPrice+0
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+0, sellCostMeanBuyPrice = sellCostMeanBuyPrice+0
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+0, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+0
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+0
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+0
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+0
                        , returnSellVal = returnSellVal+2750, returnSellCostBuyPrice = returnSellCostBuyPrice+2650, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+2650
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+2650, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+2650
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+2650
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+2650
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+2650
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+2650;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, -2750, -2650, -2650
                    , -2650, -2650, -2650, -2650, -2650, -2650)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+-2750, netSellCostBuyPrice = netSellCostBuyPrice+-2650
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+-2650
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+-2650
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+-2650
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+-2650
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+-2650
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+-2650
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+-2650;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad752074fbf1 and sellbillId = 37 and returnsellbillId = 37
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:06:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:36:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:36:07', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15374
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-20 11:06:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:36:55", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 14:36:55', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15375
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-20 11:06:56";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 14:36:56", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 14:36:56', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15376
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:07:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:37:18", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:37:18', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15377
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:07:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:37:21", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 14:37:21', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15378
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:07:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:37:25", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:37:25', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15379
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:08:55";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:09:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:39:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 14:39:56', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=157'); -- id=15380
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:10:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:40:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 14:40:02', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15381
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:10:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:40:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 14:40:07', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15382
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-20 11:10:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:40:32", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 14:40:32', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15383
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-20 11:10:33";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 14:40:33", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 14:40:33', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15384
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:10:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:40:36", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:40:36', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15385
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:13:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:43:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 14:43:41', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15386
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:13:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:43:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 14:43:50', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15387
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:14:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:44:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 14:44:08', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15388
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:14:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:44:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 14:44:16', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15389
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:14:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:44:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 14:44:25', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15390
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:14:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:44:28", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:44:28', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15391

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7527513891
-- ----------------------------------------------------------------------------------------------------

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-20 14:44:28', '06ad7527513891', '1', '0.00', '0', '50', '1', '29450.00', '29400', '29400', '0', '2', '2026-10-20 14:44:28', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '75' ,'0','','','','','-1','0','0','0','0','0','29400','0','','0','0','29400','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1117
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','اضافة فاتورة مبيعات','1117', '0', '2026-10-20 14:44:28', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '29400', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 14:44:28','0','0','',''); -- id=1336
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+28 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', '1117', '87', '1325', '28', '390', '10920', '0', '', '0', '2026-10-20 14:44:28', '1325', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','133-28,','1','1','0','0','390','10920','0','','0','0.00','0','0','0','0'); -- id=4461
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 = 4461;
 INSERT INTO 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-20', 10901.460101868, 9800, 9800
                    , 9800, 9800, 9800, 9800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 28, 0, 9800, 9800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10901.460101868, sellCostBuyPrice =sellCostBuyPrice+9800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+28
                        , netQuantityRet = netQuantityRet+0;
 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-20', 10901.460101868, 9800, 9800
                    , 9800, 9800, 9800, 9800
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9800, 9800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10901.460101868, sellCostBuyPrice =sellCostBuyPrice+9800
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9800, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9800
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9800, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9800
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9800
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9800
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9800
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '172', userid = '4', storedetaildate = '2026-10-20 14:44:28' WHERE storedetailid = '1406';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1325', '2', '28', '1', '1117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '200', '172', '4', '2026-10-20 14:44:28','0','0'); -- id=15303
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 224;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6729;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01443', '1117', '88', '1443', '12', '410', '4920', '0', '', '0', '2026-10-20 14:44:28', '1443', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','224-3,6729-9,','1','1','0','0','410','4920','0','','0','0.00','0','0','0','0'); -- id=4462
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 = 4462;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1443, '2026-10-20', 4911.6468590832, 4560, 4560
                    , 4560, 4560, 4560, 4560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4560, 4560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4911.6468590832, sellCostBuyPrice =sellCostBuyPrice+4560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4911.6468590832, 4560, 4560
                    , 4560, 4560, 4560, 4560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4560, 4560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4911.6468590832, sellCostBuyPrice =sellCostBuyPrice+4560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '23', userid = '4', storedetaildate = '2026-10-20 14:44:28' WHERE storedetailid = '1474';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1443', '2', '12', '1', '1117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '35', '23', '4', '2026-10-20 14:44:28','0','0'); -- id=15304
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6730;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01442', '1117', '88', '1442', '12', '440', '5280', '0', '', '0', '2026-10-20 14:44:28', '1442', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6730-12,','1','1','0','0','440','5280','0','','0','0.00','0','0','0','0'); -- id=4463
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 = 4463;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1442, '2026-10-20', 5271.0356536503, 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+5271.0356536503, 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-20', 5271.0356536503, 4920, 4920
                    , 4920, 4920, 4920, 4920
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4920, 4920, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5271.0356536503, 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 = '72', userid = '4', storedetaildate = '2026-10-20 14:44:28' WHERE storedetailid = '1473';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1442', '2', '12', '1', '1117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '84', '72', '4', '2026-10-20 14:44:28','0','0'); -- id=15305
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6447;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('265.5','02118', '1117', '182', '2118', '6', '295', '1770', '0', '', '0', '2026-10-20 14:44:28', '2118', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6447-6,','1','1','0','0','295','1770','0','','0','0.00','0','0','0','0'); -- id=4464
UPDATE sellbilldetail SET  lastbuyprice = 295.00 , meanbuyprice = 295.00, lastbuyprice_withDiscount = 265.50, meanbuyprice_withDiscount = 265.50
        , lastbuyprice_withTax = 295, meanbuyprice_withTax = 295, lastbuyprice_withDiscountAndTax = 265.5
                where sellbilldetailid = 4464;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2118, '2026-10-20', 1766.9949066214, 1770, 1770
                    , 1770, 1593, 1593, 1593
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1766.9949066214, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1593, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1593
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1593
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1770
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1766.9949066214, 1770, 1770
                    , 1770, 1593, 1593, 1593
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1770, 1770, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1766.9949066214, sellCostBuyPrice =sellCostBuyPrice+1770
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1770, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1770
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1593, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1593
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1593
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1770
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1770
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '21', userid = '4', storedetaildate = '2026-10-20 14:44:28' WHERE storedetailid = '3576';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2118', '2', '6', '1', '1117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '21', '4', '2026-10-20 14:44:28','0','0'); -- id=15306
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6465;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('405','02127', '1117', '182', '2127', '3', '450', '1350', '0', '', '0', '2026-10-20 14:44:28', '2127', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6465-3,','1','1','0','0','450','1350','0','','0','0.00','0','0','0','0'); -- id=4465
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 405.00, meanbuyprice_withDiscount = 405.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 405
                where sellbilldetailid = 4465;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2127, '2026-10-20', 1347.7079796265, 1350, 1350
                    , 1350, 1215, 1215, 1215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1347.7079796265, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1347.7079796265, 1350, 1350
                    , 1350, 1215, 1215, 1215
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1347.7079796265, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1215, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1215
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1215
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '4', storedetaildate = '2026-10-20 14:44:28' WHERE storedetailid = '3585';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2127', '2', '3', '1', '1117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '15', '12', '4', '2026-10-20 14:44:28','0','0'); -- id=15307
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6449;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('301.5','02119', '1117', '182', '2119', '6', '335', '2010', '0', '', '0', '2026-10-20 14:44:28', '2119', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6449-6,','1','1','0','0','335','2010','0','','0','0.00','0','0','0','0'); -- id=4466
UPDATE sellbilldetail SET  lastbuyprice = 335.00 , meanbuyprice = 335.00, lastbuyprice_withDiscount = 301.50, meanbuyprice_withDiscount = 318.25
        , lastbuyprice_withTax = 335, meanbuyprice_withTax = 167.5, lastbuyprice_withDiscountAndTax = 301.5
                where sellbilldetailid = 4466;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2119, '2026-10-20', 2006.5874363328, 2010, 2010
                    , 2010, 1809, 1909.5, 1809
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2010, 1005, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2006.5874363328, sellCostBuyPrice =sellCostBuyPrice+2010
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2010, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2010
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1809, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1909.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1809
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2010
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1005
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2006.5874363328, 2010, 2010
                    , 2010, 1809, 1909.5, 1809
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2010, 1005, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2006.5874363328, sellCostBuyPrice =sellCostBuyPrice+2010
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2010, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2010
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1809, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1909.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1809
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2010
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1005
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '42', userid = '4', storedetaildate = '2026-10-20 14:44:28' WHERE storedetailid = '3577';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2119', '2', '6', '1', '1117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '42', '4', '2026-10-20 14:44:28','0','0'); -- id=15308
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 6735;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','02253', '1117', '197', '2253', '8', '400', '3200', '0', '', '0', '2026-10-20 14:44:28', '2253', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6735-8,','1','1','0','0','400','3200','0','','0','0.00','0','0','0','0'); -- id=4467
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 4467;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2253, '2026-10-20', 3194.5670628183, 3200, 3200
                    , 3200, 2880, 3040, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3200, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3194.5670628183, sellCostBuyPrice =sellCostBuyPrice+3200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3200
                            , 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+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-20', 3194.5670628183, 3200, 3200
                    , 3200, 2880, 3040, 2880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3200, 1600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3194.5670628183, sellCostBuyPrice =sellCostBuyPrice+3200
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3200, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3200
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3200
                            , 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 = '64', userid = '4', storedetaildate = '2026-10-20 14:44:28' WHERE storedetailid = '3653';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2253', '2', '8', '1', '1117', 'اضافة فاتورة مبيعات', 'sellbillController.php', '72', '64', '4', '2026-10-20 14:44:28','0','0'); -- id=15309
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1112732.875',  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 ('1083332.875','29400', '0', '3', 'اضافة فاتورة مبيعات', '1117', '1112732.875', '2026-10-20 14:44:28', '4',  'sellbillController.php','1','','0'); -- id=1380
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '29450', '29450', '2026-10-20', '4', '0', '0', '2026-10-20 14:44:28','اضافة فاتورة مبيعات رقم 1117','1','0',null,'0','1117','sellbillController.php?do=showDetail&sellbillid=1117'); -- id=3974
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3974', '501', '29400', '','0'); -- id=4078
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1112732.9', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3974', '398', '50', '','0'); -- id=4079
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510114.1', 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 ('3974', '143', '29450', '','0'); -- id=3976
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12653190', 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 ( '26777', '26777', '2026-10-20', '4', '0', '0', '2026-10-20 14:44:28','اضافة فاتورة مبيعات رقم 1117 - صرف البضاعة من المخزن','1','0',null,'0','1117','sellbillController.php?do=showDetail&sellbillid=1117'); -- id=3975
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3975', '402', '26777', '','0'); -- id=4080
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11708857.61', 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 ('3975', '492', '26777', '','0'); -- id=3977
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1643511', 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='3974,0,3975' where sellbillid=1117;
 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-20', 29400, 27610, 27610
                    , 27610, 26777, 27037.5, 26777
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,27610, 25005, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+29400, sellCostBuyPrice =sellCostBuyPrice+27610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+27610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+27610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26777, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+27037.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26777
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+27610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+25005
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 29400, 27610, 27610
                    , 27610, 26777, 27037.5, 26777
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,27610, 25005, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+29400, sellCostBuyPrice =sellCostBuyPrice+27610
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+27610, sellCostMeanBuyPrice = sellCostMeanBuyPrice+27610
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+26777, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+27037.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+26777
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+27610
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+25005
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 29400, 27610, 27610
                    , 27610, 26777, 27037.5, 26777, 27610, 25005)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+29400, netSellCostBuyPrice = netSellCostBuyPrice+27610
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+27610
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+27610
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+26777
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+27037.5
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+26777
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+27610
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+25005;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7527513891 and sellbillId = 1117 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:14:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:44:28", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:44:28', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15392
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:14:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:44:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 14:44:32', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15393
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:14:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:44:57", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:44:57', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15394
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:14:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:44:57", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:44:57', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15395
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:18:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:48:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:48:03', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15396

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad75204b766c
-- ----------------------------------------------------------------------------------------------------

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-20 14:48:03', '06ad75204b766c', '1', '0.00', '0', '0', '1', '6660.00', '6660', '6660', '0', '1', '2026-10-20 14:48:03', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '18' ,'0','','','','','-1','0','0','0','0','0','6660','0','','0','0','6660','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1118
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','اضافة فاتورة مبيعات','1118', '0', '2026-10-20 14:48:03', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6660', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 14:48:03','0','0','',''); -- id=1337
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 235;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','01456', '1118', '94', '1456', '12', '360', '4320', '0', '', '0', '2026-10-20 14:48:03', '1456', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','235-12,','1','1','0','0','360','4320','0','','0','0.00','0','0','0','0'); -- id=4468
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 4468;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1456, '2026-10-20', 4320, 3840, 3840
                    , 3840, 3840, 3840, 3840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3840, 3840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+3840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4320, 3840, 3840
                    , 3840, 3840, 3840, 3840
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3840, 3840, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+3840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3840, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3840
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3840
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3840
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3840
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '2', storedetaildate = '2026-10-20 14:48:03' WHERE storedetailid = '1481';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1456', '1', '12', '1', '1118', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '27', '2', '2026-10-20 14:48:03','0','0'); -- id=15310
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 72;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01380', '1118', '94', '1380', '6', '390', '2340', '0', '', '0', '2026-10-20 14:48:03', '1380', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','72-6,','1','1','0','0','390','2340','0','','0','0.00','0','0','0','0'); -- id=4469
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 = 4469;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1380, '2026-10-20', 2340, 2100, 2100
                    , 2100, 2100, 2100, 2100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2340, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2340, 2100, 2100
                    , 2100, 2100, 2100, 2100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2340, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '388', userid = '2', storedetaildate = '2026-10-20 14:48:03' WHERE storedetailid = '1380';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1380', '1', '6', '1', '1118', 'اضافة فاتورة مبيعات', 'sellbillController.php', '394', '388', '2', '2026-10-20 14:48:03','0','0'); -- id=15311
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6979603.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6972943.5','6660', '0', '2', 'اضافة فاتورة مبيعات', '1118', '6979603.5', '2026-10-20 14:48:03', '2',  'sellbillController.php','1','','0'); -- id=1381
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6660', '6660', '2026-10-20', '2', '0', '0', '2026-10-20 14:48:03','اضافة فاتورة مبيعات رقم 1118','1','0',null,'0','1118','sellbillController.php?do=showDetail&sellbillid=1118'); -- id=3976
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3976', '419', '6660', '','0'); -- id=4081
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6979603', 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 ('3976', '143', '6660', '','0'); -- id=3978
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12659850', 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 ( '5940', '5940', '2026-10-20', '2', '0', '0', '2026-10-20 14:48:03','اضافة فاتورة مبيعات رقم 1118 - صرف البضاعة من المخزن','1','0',null,'0','1118','sellbillController.php?do=showDetail&sellbillid=1118'); -- id=3977
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3977', '402', '5940', '','0'); -- id=4082
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11714797.61', 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 ('3977', '382', '5940', '','0'); -- id=3979
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23834855.59', 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='3976,0,3977' where sellbillid=1118;
 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-20', 6660, 5940, 5940
                    , 5940, 5940, 5940, 5940
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5940, 5940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6660, sellCostBuyPrice =sellCostBuyPrice+5940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5940
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5940
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 6660, 5940, 5940
                    , 5940, 5940, 5940, 5940
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5940, 5940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6660, sellCostBuyPrice =sellCostBuyPrice+5940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5940, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5940
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5940
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5940
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5940
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 6660, 5940, 5940
                    , 5940, 5940, 5940, 5940, 5940, 5940)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6660, netSellCostBuyPrice = netSellCostBuyPrice+5940
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5940
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5940
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5940
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5940
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5940
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5940
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5940;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad75204b766c and sellbillId = 1118 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:18:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:48:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:48:03', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15397
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:21:10";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:25:39";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:25:39";
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-20 11:25:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:55:41", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 14:55:41', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15398
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-20 11:25:42";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 14:55:42", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 14:55:42', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15399
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:25:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:55:44", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:55:44', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15400
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:25:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:55:52", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 14:55:52', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15401
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:25:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:55:58", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:55:58', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15402
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:26:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:56:01", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 14:56:01', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15403
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:26:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 14:56:09", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 14:56:09', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15404
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:32:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:02:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:02:34', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15405
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:32:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:02:44", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:02:44', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15406
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:33:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:03:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 15:03:19', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15407
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-20 11:33:19";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 15:03:20', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15408
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:33:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:03:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:03:22', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15409
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:33:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:03:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:03:28', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15410
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:33:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:03:28", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:03:28', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=5'); -- id=15411
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:33:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:03:31", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:03:31', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15412
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:33:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:03:32", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:03:32', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15413
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:33:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:03:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:03:36', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15414
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:33:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:03:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:03:40', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15415
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:33:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:03:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:03:56', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15416
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:34:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:04:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:04:05', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15417
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:34:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:04:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 15:04:11', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15418
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-20 11:34:12";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 15:04:12', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15419
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:34:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:04:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:04:15', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15420
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:34:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:04:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:04:56', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15421
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:35:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:05:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:05:06', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15422
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:35:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:05:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:05:45', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15423
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:37:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:07:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:07:26', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15424
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('اوفر سايز تربو','','185','610','610','0','0','2026-10-20','0','1','0','02318','0','0','0','0','0','610','610','610','610','610','0','0','0','0','.','0','0','0','610','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','610','610','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','610','0','0','0','0','0','0','','','0','0','0','0'); -- id=2264
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2264', '1', '2026-10-20', '1', '0','0226401','610','0','0','610','','0','0','0','0','0','0','0','0','0','0'); -- id=2264
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2264', '1', '0', '1', '2026-10-20'); -- id=3657
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2264', '1', '0', '0', '2264', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15312
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2264, 1,'2026-10-20 15:07:26',1)
                ON DUPLICATE KEY UPDATE productid = 2264, edited = 1, sysdate = '2026-10-20 15:07:26', userid = 1; -- id=3317
UPDATE product SET productName = 'اوفر سايز تربو', productDescription = '', productCatId = '185', productBuyPrice = '610.00', productSellAllPrice = '610.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02318',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '610',lastbuyprice_withDiscount = '610',meanbuyprice = '610',meanbuyprice_withDiscount = '610' , productbuypricereal = '610' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='610',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='610',meanbuyprice_withTax='610',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='610',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2264';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('اوفر سايز اسفنجي تربو','','185','440','440','0','0','2026-10-20','0','1','0','02139','0','0','0','0','0','440','440','440','440','440','0','0','0','0','.','0','0','0','440','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','440','440','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','440','0','0','0','0','0','0','','','0','0','0','0'); -- id=2265
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2265', '1', '2026-10-20', '1', '0','0226501','440','0','0','440','','0','0','0','0','0','0','0','0','0','0'); -- id=2265
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2265', '1', '0', '1', '2026-10-20'); -- id=3658
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2265', '1', '0', '0', '2265', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15313
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2265, 1,'2026-10-20 15:07:26',1)
                ON DUPLICATE KEY UPDATE productid = 2265, edited = 1, sysdate = '2026-10-20 15:07:26', userid = 1; -- id=3318
UPDATE product SET productName = 'اوفر سايز اسفنجي تربو', productDescription = '', productCatId = '185', productBuyPrice = '440.00', productSellAllPrice = '440.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02139',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '440',lastbuyprice_withDiscount = '440',meanbuyprice = '440',meanbuyprice_withDiscount = '440' , productbuypricereal = '440' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='440',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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 = '2265';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:37:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:07:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:07:28', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15425
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:37:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:07:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:07:33', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15426
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:37:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:07:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:07:39', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15427
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:37:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:07:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 15:07:41', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=195'); -- id=15428
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:37:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:07:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:07:49', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15429
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:38:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:08:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:08:08', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15430
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:39:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:09:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 15:09:06', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15431
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:39:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:09:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 15:09:15', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15432
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:39:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:09:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:09:56', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15433
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:39:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:09:59", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 15:09:59', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15434
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-20 11:39:59";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 15:09:59', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15435
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:40:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:10:01", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:10:01', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15436
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:40:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:10:01", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:10:01', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15437
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:40:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:10:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:10:02', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15438
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:42:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:12:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 15:12:04', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15439
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:42:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:12:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 15:12:13', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15440
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:42:55";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:43:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:13:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:13:05', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15441
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:43:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:13:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:13:13', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15442
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:43:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:13:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-20 15:13:15', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=details&id=17'); -- id=15443
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-20 11:43:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:13:32", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 15:13:32', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15444
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-20 11:43:32";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 15:13:32', '5', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15445
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:43:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:13:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:13:38', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15446
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:44:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:14:32", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:14:32', '3', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15447

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7589411a0e
-- ----------------------------------------------------------------------------------------------------

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-20 15:14:32', '06ad7589411a0e', '1', '0.00', '0', '0', '1', '4050.00', '4050', '4050', '0', '1', '2026-10-20 15:14:32', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','4050','0','','0','0','4050','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1119
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','اضافة فاتورة مبيعات','1119', '0', '2026-10-20 15:14:32', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4050', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 15:14:32','0','0','',''); -- id=1338
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 996;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('414','01902', '1119', '149', '1902', '3', '450', '1350', '0', '', '0', '2026-10-20 15:14:32', '1902', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','996-3,','1','1','0','0','450','1350','0','','0','0.00','0','0','0','0'); -- id=4470
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 432.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 4470;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1902, '2026-10-20', 1350, 1350, 1350
                    , 1350, 1242, 1296, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1350, 675, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1296
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1242
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+675
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-20', 1350, 1350, 1350
                    , 1350, 1242, 1296, 1242
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1350, 675, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1350, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1242, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1296
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1242
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+675
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '3', storedetaildate = '2026-10-20 15:14:32' WHERE storedetailid = '2919';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1902', '1', '3', '1', '1119', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '15', '3', '2026-10-20 15:14:32','0','0'); -- id=15314
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 993;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('414','01899', '1119', '149', '1899', '6', '450', '2700', '0', '', '0', '2026-10-20 15:14:32', '1899', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','993-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=4471
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 432.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 225, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 4471;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1899, '2026-10-20', 2700, 2700, 2700
                    , 2700, 2484, 2592, 2484
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2700, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2484, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2592
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2484
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2700, 2700, 2700
                    , 2700, 2484, 2592, 2484
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2700, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2700
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2700, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2700
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2484, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2592
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2484
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2700
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 15:14:32' WHERE storedetailid = '2916';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1899', '1', '6', '1', '1119', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '12', '3', '2026-10-20 15:14:32','0','0'); -- id=15315
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6983653.5',  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 ('6979603.5','4050', '0', '2', 'اضافة فاتورة مبيعات', '1119', '6983653.5', '2026-10-20 15:14:32', '3',  'sellbillController.php','1','','0'); -- id=1382
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4050', '4050', '2026-10-20', '3', '0', '0', '2026-10-20 15:14:32','اضافة فاتورة مبيعات رقم 1119','1','0',null,'0','1119','sellbillController.php?do=showDetail&sellbillid=1119'); -- id=3978
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3978', '419', '4050', '','0'); -- id=4083
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6983653', 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 ('3978', '143', '4050', '','0'); -- id=3980
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12663900', 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 ( '3726', '3726', '2026-10-20', '3', '0', '0', '2026-10-20 15:14:32','اضافة فاتورة مبيعات رقم 1119 - صرف البضاعة من المخزن','1','0',null,'0','1119','sellbillController.php?do=showDetail&sellbillid=1119'); -- id=3979
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3979', '402', '3726', '','0'); -- id=4084
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11718523.61', 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 ('3979', '382', '3726', '','0'); -- id=3981
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23831129.59', 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='3978,0,3979' where sellbillid=1119;
 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-20', 4050, 4050, 4050
                    , 4050, 3726, 3888, 3726
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4050, 2025, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3726, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3888
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3726
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2025
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4050, 4050, 4050
                    , 4050, 3726, 3888, 3726
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4050, 2025, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, sellCostBuyPrice =sellCostBuyPrice+4050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3726, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3888
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3726
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2025
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 4050, 4050, 4050
                    , 4050, 3726, 3888, 3726, 4050, 2025)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4050, netSellCostBuyPrice = netSellCostBuyPrice+4050
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4050
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4050
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3726
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3888
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3726
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4050
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2025;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7589411a0e and sellbillId = 1119 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:44:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:14:32", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:14:32', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15448
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:46:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:16:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 15:16:02', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php'); -- id=15449
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 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-20 11:46:16";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:16:17", 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-20 11:46:17";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 15:16:17", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:46:19";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:46:23";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:16:23", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:46:49";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:16:49", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:47:01";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:17:01", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:47:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:17:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 15:17:28', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=add'); -- id=15450
BEGIN;
CALL supplierInUse(67,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
UPDATE supplier SET  suppliercurrentDebt = '48898.5',suppliercurrentDebtInCurrency= '48898.5' , userid = '1', supplierdate = '26-10-20'   WHERE supplierid = '67';
UPDATE supplier SET  inUse = 0 where supplierid = 67;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2350', '2350', '2026-10-20', '1', '0', '0', '2026-10-20 15:17:28','تسوية عجز مورد بالخصم','1','0','0','0','0',''); -- id=3980
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3980', '486', '2350', '','0'); -- id=4085
UPDATE accountstree SET name = 'نمبر وان - مورد', customName = 'نمبر وان - مورد', customNameEn = 'نمبر وان - مورد', nameEn = 'نمبر وان - مورد', parent = '81', accountNature = '1', theValue = '-42674.5', 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 = '486';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3980', '146', '2350', '','0'); -- id=3982
UPDATE accountstree SET name = 'ايرادات الخصم المكتسب', customName = 'ايرادات الخصم المكتسب', customNameEn = 'Acquired Discount Revenues', nameEn = 'Acquired Discount Revenues', parent = '147', accountNature = '1', theValue = '5633034', 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 ('67', '51248.50', '2350', '1', 'تسوية عجز مورد بالخصم', '-1', '48898.5', '2026-10-20 15:17:28', '1', 'supplierDeficitController.php', 'خصم الرجاله', '3980','', '0','1','1','2350','1','0','0','0','0',''); -- id=755
UPDATE supplierdebtchange SET supplierid = '67', supplierdebtchangebefore = '51248.50', supplierdebtchangeamount = '2350', supplierdebtchangetype = '1', processname = 'تسوية عجز مورد بالخصم', supplierdebtchangemodelid = '-1', supplierdebtchangeafter = '48898.5', supplierdebtchangedate = '2026-10-20 15:17:28', userid = '1', tablename = 'supplierDeficitController.php', comment = 'خصم الرجاله', dailyentryid = '3980',saveid = '',currencyId='1',conversionFactor='1',payedInCurrency='2350',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='48898.5',debtchangamountInSupplierCurrency='2350',debtchangafterInSupplierCurrency='48898.5', paySerialNo='0',tagids='' WHERE supplierdebtchangeid = '755';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:47:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:17:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 15:17:29', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=sucess'); -- id=15451
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:47:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:17:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 15:17:30', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=show'); -- id=15452
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:47:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:17:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:17:31', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15453
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:47:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:17:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:17:36', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15454
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:47:49";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:17:49", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:47:51";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:48:20";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:18:20", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:49:28";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:19:28", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:50:38";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:20:38", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:50:47";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:20:47", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:51:06";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:21:06", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:51:54";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:21:54", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:52:03";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:22:03", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:52:07";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:22:07", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:52:30";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:54:01";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:24:01", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:54:01";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:24:01", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:54:09";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:24:09", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:54:15";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:24:15", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:55:40";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:25:40", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:55:55";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:25:55", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:56:11";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:26:11", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:56:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:26:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 15:26:31', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15455
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:58:27";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:58:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:28:46", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:28:46', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15456

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad756d9aacf6
-- ----------------------------------------------------------------------------------------------------

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-20 15:28:46', '06ad756d9aacf6', '1', '0.00', '0', '0', '1', '6510.00', '6510', '6510', '0', '1', '2026-10-20 15:28:46', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '18' ,'0','','','','','-1','0','0','0','0','0','6510','0','','0','0','6510','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1120
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','1120', '0', '2026-10-20 15:28:46', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '6510', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 15:28:46','0','0','',''); -- id=1339
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6479;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02203', '1120', '191', '2203', '6', '345', '2070', '0', '', '0', '2026-10-20 15:28:46', '2203', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6479-6,','1','1','0','0','345','2070','0','','0','0.00','0','0','0','0'); -- id=4472
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 = 4472;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2203, '2026-10-20', 2070, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2070, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2070, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2070, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '33', userid = '6', storedetaildate = '2026-10-20 15:28:46' WHERE storedetailid = '3592';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2203', '1', '6', '1', '1120', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '33', '6', '2026-10-20 15:28:46','0','0'); -- id=15316
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6707;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','02252', '1120', '191', '2252', '12', '370', '4440', '0', '', '0', '2026-10-20 15:28:46', '2252', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6707-12,','1','1','0','0','370','4440','0','','0','0.00','0','0','0','0'); -- id=4473
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 4473;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2252, '2026-10-20', 4440, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4440, 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+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-20', 4440, 3600, 3600
                    , 3600, 3600, 3600, 3600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3600, 3600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4440, 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 = '122', userid = '6', storedetaildate = '2026-10-20 15:28:46' WHERE storedetailid = '3643';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2252', '1', '12', '1', '1120', 'اضافة فاتورة مبيعات', 'sellbillController.php', '134', '122', '6', '2026-10-20 15:28:46','0','0'); -- id=15317
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '941980',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('935470','6510', '0', '4', 'اضافة فاتورة مبيعات', '1120', '941980', '2026-10-20 15:28:46', '6',  'sellbillController.php','1','','0'); -- id=1383
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '6510', '6510', '2026-10-20', '6', '0', '0', '2026-10-20 15:28:46','اضافة فاتورة مبيعات رقم 1120','1','0',null,'0','1120','sellbillController.php?do=showDetail&sellbillid=1120'); -- id=3981
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3981', '568', '6510', '','0'); -- id=4086
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '941980', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3981', '143', '6510', '','0'); -- id=3983
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12670410', 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 ( '5280', '5280', '2026-10-20', '6', '0', '0', '2026-10-20 15:28:46','اضافة فاتورة مبيعات رقم 1120 - صرف البضاعة من المخزن','1','0',null,'0','1120','sellbillController.php?do=showDetail&sellbillid=1120'); -- id=3982
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3982', '402', '5280', '','0'); -- id=4087
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11723803.61', 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 ('3982', '382', '5280', '','0'); -- id=3984
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23825849.59', 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='3981,0,3982' where sellbillid=1120;
 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-20', 6510, 5280, 5280
                    , 5280, 5280, 5280, 5280
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5280, 5280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6510, sellCostBuyPrice =sellCostBuyPrice+5280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 6510, 5280, 5280
                    , 5280, 5280, 5280, 5280
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,5280, 5280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6510, sellCostBuyPrice =sellCostBuyPrice+5280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5280, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5280
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5280
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5280
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5280
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 6510, 5280, 5280
                    , 5280, 5280, 5280, 5280, 5280, 5280)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+6510, netSellCostBuyPrice = netSellCostBuyPrice+5280
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+5280
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+5280
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+5280
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+5280
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+5280
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+5280
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+5280;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad756d9aacf6 and sellbillId = 1120 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:58:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:28:47", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:28:47', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15457
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-20 11:58:54";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:28:54", deviceType = "DESKTOP" 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-20 11:58:54";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 15:28:54", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:59:13";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:29:13", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:59:27";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:29:27", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 11:59:36";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:29:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:00:02";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:30:02", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:00:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:30:14", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:30:14', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15458
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:00:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:30:14", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:30:14', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15459
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:03:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:33:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 15:33:56', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15460
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-20 12:03:56";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 15:33:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 15:33:56', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15461
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:03:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:33:59", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:33:59', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15462
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:04:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:34:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:34:03', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15463

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad754f38d8c8
-- ----------------------------------------------------------------------------------------------------

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-20 15:34:03', '06ad754f38d8c8', '1', '0.00', '0', '0', '1', '11455.00', '11455', '11455', '0', '1', '2026-10-20 15:34:03', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '29' ,'0','','','','','-1','0','0','0','0','0','11455','0','','0','0','11455','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1121
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','اضافة فاتورة مبيعات','1121', '0', '2026-10-20 15:34:03', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '11455', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 15:34:03','0','0','',''); -- id=1340
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+29 where id = 1081;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01920', '1121', '153', '1920', '29', '395', '11455', '0', '', '0', '2026-10-20 15:34:03', '1920', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1081-29,','1','1','0','0','395','11455','0','','0','0.00','0','0','0','0'); -- id=4474
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 = 4474;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1920, '2026-10-20', 11455, 10730, 10730
                    , 10730, 10730, 10730, 10730
                    , 0, 0, 0, 0
                    , 0, 0, 0, 29, 0, 10730, 10730, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11455, sellCostBuyPrice =sellCostBuyPrice+10730
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10730, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10730
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10730, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10730
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10730
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10730
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10730
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+29
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 11455, 10730, 10730
                    , 10730, 10730, 10730, 10730
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10730, 10730, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11455, sellCostBuyPrice =sellCostBuyPrice+10730
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10730, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10730
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10730, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10730
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10730
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10730
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10730
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2026-10-20 15:34:03' WHERE storedetailid = '2937';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1920', '1', '29', '1', '1121', 'اضافة فاتورة مبيعات', 'sellbillController.php', '41', '12', '2', '2026-10-20 15:34:03','0','0'); -- id=15318
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6995108.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6983653.5','11455', '0', '2', 'اضافة فاتورة مبيعات', '1121', '6995108.5', '2026-10-20 15:34:03', '2',  'sellbillController.php','1','','0'); -- id=1384
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '11455', '11455', '2026-10-20', '2', '0', '0', '2026-10-20 15:34:03','اضافة فاتورة مبيعات رقم 1121','1','0',null,'0','1121','sellbillController.php?do=showDetail&sellbillid=1121'); -- id=3983
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3983', '419', '11455', '','0'); -- id=4088
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6995108', 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 ('3983', '143', '11455', '','0'); -- id=3985
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12681865', 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 ( '10730', '10730', '2026-10-20', '2', '0', '0', '2026-10-20 15:34:03','اضافة فاتورة مبيعات رقم 1121 - صرف البضاعة من المخزن','1','0',null,'0','1121','sellbillController.php?do=showDetail&sellbillid=1121'); -- id=3984
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3984', '402', '10730', '','0'); -- id=4089
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11734533.61', 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 ('3984', '382', '10730', '','0'); -- id=3986
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23815119.59', 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='3983,0,3984' where sellbillid=1121;
 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-20', 11455, 10730, 10730
                    , 10730, 10730, 10730, 10730
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10730, 10730, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11455, sellCostBuyPrice =sellCostBuyPrice+10730
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10730, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10730
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10730, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10730
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10730
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10730
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10730
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 11455, 10730, 10730
                    , 10730, 10730, 10730, 10730
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10730, 10730, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11455, sellCostBuyPrice =sellCostBuyPrice+10730
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10730, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10730
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10730, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10730
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10730
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10730
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10730
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 11455, 10730, 10730
                    , 10730, 10730, 10730, 10730, 10730, 10730)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+11455, netSellCostBuyPrice = netSellCostBuyPrice+10730
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+10730
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+10730
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+10730
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+10730
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+10730
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+10730
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+10730;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad754f38d8c8 and sellbillId = 1121 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:04:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:34:03", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:34:03', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15464
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:06:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:36:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:36:58', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15465
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:08:52";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:38:52", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:09:26";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:39:26", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:09:36";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:39:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:17:50";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:47:50", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:17:59";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:47:59", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:18:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:48:01", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:48:01', '5', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15466
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:18:01";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:18:06";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:48:06", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:18:36";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 15:48:36", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:18:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:48:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:48:56', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15467

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad75fbbbfad0
-- ----------------------------------------------------------------------------------------------------

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-20 15:48:56', '06ad75fbbbfad0', '1', '0.00', '0', '0', '1', '7020.00', '7020', '7020', '0', '1', '2026-10-20 15:48:56', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '24' ,'0','','','','','-1','0','0','0','0','0','7020','0','','0','0','7020','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1122
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','اضافة فاتورة مبيعات','1122', '0', '2026-10-20 15:48:56', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '7020', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 15:48:56','0','0','',''); -- id=1341
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6641;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','02240', '1122', '76', '2240', '12', '340', '4080', '0', '', '0', '2026-10-20 15:48:56', '2240', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6641-12,','1','1','0','0','340','4080','0','','0','0.00','0','0','0','0'); -- id=4475
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 306.00, meanbuyprice_withDiscount = 323.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 170, lastbuyprice_withDiscountAndTax = 306
                where sellbilldetailid = 4475;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2240, '2026-10-20', 4080, 4080, 4080
                    , 4080, 3672, 3876, 3672
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 4080, 2040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4080, sellCostBuyPrice =sellCostBuyPrice+4080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3672, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3876
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3672
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4080, 4080, 4080
                    , 4080, 3672, 3876, 3672
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4080, 2040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4080, sellCostBuyPrice =sellCostBuyPrice+4080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3672, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3876
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3672
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '2', storedetaildate = '2026-10-20 15:48:56' WHERE storedetailid = '3631';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2240', '1', '12', '1', '1122', 'اضافة فاتورة مبيعات', 'sellbillController.php', '30', '18', '2', '2026-10-20 15:48:56','0','0'); -- id=15319
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6284;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','02175', '1122', '190', '2175', '12', '245', '2940', '0', '', '0', '2026-10-20 15:48:56', '2175', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6284-12,','1','1','0','0','245','2940','0','','0','0.00','0','0','0','0'); -- id=4476
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 4476;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2175, '2026-10-20', 2940, 2760, 2760
                    , 2760, 2760, 2760, 2760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2940, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2760
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2940, 2760, 2760
                    , 2760, 2760, 2760, 2760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2760, 2760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2940, sellCostBuyPrice =sellCostBuyPrice+2760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2760
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '25', userid = '2', storedetaildate = '2026-10-20 15:48:56' WHERE storedetailid = '3535';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2175', '1', '12', '1', '1122', 'اضافة فاتورة مبيعات', 'sellbillController.php', '37', '25', '2', '2026-10-20 15:48:56','0','0'); -- id=15320
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7002128.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('6995108.5','7020', '0', '2', 'اضافة فاتورة مبيعات', '1122', '7002128.5', '2026-10-20 15:48:56', '2',  'sellbillController.php','1','','0'); -- id=1385
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '7020', '7020', '2026-10-20', '2', '0', '0', '2026-10-20 15:48:56','اضافة فاتورة مبيعات رقم 1122','1','0',null,'0','1122','sellbillController.php?do=showDetail&sellbillid=1122'); -- id=3985
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3985', '419', '7020', '','0'); -- id=4090
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7002128', 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 ('3985', '143', '7020', '','0'); -- id=3987
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12688885', 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 ( '6432', '6432', '2026-10-20', '2', '0', '0', '2026-10-20 15:48:56','اضافة فاتورة مبيعات رقم 1122 - صرف البضاعة من المخزن','1','0',null,'0','1122','sellbillController.php?do=showDetail&sellbillid=1122'); -- id=3986
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3986', '402', '6432', '','0'); -- id=4091
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11740965.61', 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 ('3986', '382', '6432', '','0'); -- id=3988
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23808687.59', 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='3985,0,3986' where sellbillid=1122;
 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-20', 7020, 6840, 6840
                    , 6840, 6432, 6636, 6432
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6840, 4800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7020, sellCostBuyPrice =sellCostBuyPrice+6840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6432, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6636
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6432
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6840
                            , 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;
 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-20', 7020, 6840, 6840
                    , 6840, 6432, 6636, 6432
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,6840, 4800, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7020, sellCostBuyPrice =sellCostBuyPrice+6840
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6840, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6840
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6432, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6636
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6432
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6840
                            , 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;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 7020, 6840, 6840
                    , 6840, 6432, 6636, 6432, 6840, 4800)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+7020, netSellCostBuyPrice = netSellCostBuyPrice+6840
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+6840
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+6840
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+6432
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+6636
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+6432
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+6840
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4800;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad75fbbbfad0 and sellbillId = 1122 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:18:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:48:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 15:48:56', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15468
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:20:14";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:50:14", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:20:22";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:50:22", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:20:33";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:50:33", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:20:40";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:50:40", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:20:44";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 15:50:44", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:21:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:51:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:51:56', '1', 'all', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15469
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:22:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:52:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:52:03', '1', 'all', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15470
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:22:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:52:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:52:08', '1', 'all', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=all'); -- id=15471
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:22:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:52:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:52:12', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15472
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:22:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:52:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 15:52:21', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15473
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:22:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:52:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 15:52:23', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=195'); -- id=15474
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:23:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:53:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:53:03', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15475
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:23:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:53:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:53:09', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15476
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:23:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:53:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:53:20', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15477
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:23:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:53:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:53:26', '1', 'edit', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=edit&id=2139'); -- id=15478
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:25:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:55:43", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 15:55:43', '5', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15479
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:25:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 15:55:45", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 15:55:45', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15480
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-20 12:25:45";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 15:55:45', '5', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15481
UPDATE user SET loginip = "" WHERE userid = 3;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:32:01";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 16:02:01", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:32:21";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 16:02:21", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:32:31";
UPDATE user SET loginip = "197.35.65.154", lastactivetime = "2026-10-20 16:02:31", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:33:30";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:33: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 user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:33:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:03:33", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:03:33', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15482
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-20 12:33:33";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:03:33', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15483
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:35:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:05:15", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 16:05:15', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15484
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:35:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:05:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 16:05:28', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=15485
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:35:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:05:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 16:05:39', '1', 'add2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=15486
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('الجرم','2026-10-20','','41', '1','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=201
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (201, 1,'2026-10-20 16:05:39',1)
                ON DUPLICATE KEY UPDATE catid = 201, edited = 1, sysdate = '2026-10-20 16:05:39', userid = 1; -- id=216
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '201', '1', '2026-10-20', '1', '0'); -- id=93
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:35:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:05:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 16:05:39', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=15487
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:35:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:05:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 16:05:41', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=15488
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:35:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:05:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:05:55', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15489
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:36:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:06:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:06:38', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15490
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:36:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:06:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 16:06:41', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15491
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:36:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:06:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 16:06:48', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15492
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:37:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:07:14", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 16:07:14', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15493
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:37:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:07:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 16:07:21', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15494
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:37:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:07:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 16:07:34', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15495
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:37:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:07:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 16:07:39', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15496
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:38:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:08:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 16:08:10', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15497
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:38:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:08:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 16:08:22', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15498
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:39:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:09:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 16:09:20', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15499
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:39:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:09:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 16:09:26', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15500
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:41:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:11:57", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:11:57', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15501
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:42:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:12:30", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:12:30', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15502
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:42:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:12:31", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:12:31', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15503
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:42:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:12:51", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:12:51', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15504
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:44:41";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:45:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:15:37", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:15:37', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1085'); -- id=15505
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:46:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:16:40", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:16:40', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15506
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:46:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:16:40", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:16:40', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15507
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:46:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:16:46", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:16:46', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15508
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:46:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:16:49", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:16:49', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15509
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:49:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:19:10", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:19:10', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15510
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:49:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:19:29", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:19:29', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15511
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:49:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:19:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:19:34', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15512
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:49:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:19:39", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:19:39', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15513
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:50:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:20:44", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:20:44', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15514
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:51:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:21:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:21:07', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15515
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:51:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:21:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:21:09', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15516
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:51:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:21:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:21:09', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15517
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:51:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:21:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:21:22', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15518
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:52:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:22:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:22:20', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15519
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:52:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:22:30", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:22:30', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15520
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-20 12:52:30";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:22:30', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15521
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:52:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:22:32", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:22:32', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15522
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:52:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:22:33", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:22:33', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15523
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:53:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:23:26", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:23:26', '5', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15524
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('جبردين جيب كيمت اكس ','','75','350','350','0','0','2026-10-20','0','5','0','','0','0','0','0','0','350','350','350','350','350','0','0','0','0','.','0','0','0','350','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','350','350','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','350','0','0','0','0','0','0','','','0','0','0','0'); -- id=2266
UPDATE product SET productName = 'جبردين جيب كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '350', productSellAllPrice = '350', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02266',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',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 = '',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='-1',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 = '2266';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2266', '1', '2026-10-20', '5', '0','0226601','350','0','0','350','','0','0','0','0','0','0','0','0','0','0'); -- id=2266
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2266', '1', '0', '5', '2026-10-20'); -- id=3659
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2266', '1', '0', '0', '2266', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15321
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2266, 1,'2026-10-20 16:23:26',5)
                ON DUPLICATE KEY UPDATE productid = 2266, edited = 1, sysdate = '2026-10-20 16:23:26', userid = 5; -- id=3319
UPDATE product SET productName = 'جبردين جيب كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02266',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',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 = '',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='-1',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 = '2266';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('انترلوك مستورد كيمت اكس','','75','340','340','0','0','2026-10-20','0','5','0','','0','0','0','0','0','340','340','340','340','340','0','0','0','0','.','0','0','0','340','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','340','340','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','340','0','0','0','0','0','0','','','0','0','0','0'); -- id=2267
UPDATE product SET productName = 'انترلوك مستورد كيمت اكس', productDescription = '', productCatId = '75', productBuyPrice = '340', productSellAllPrice = '340', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02267',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340',lastbuyprice_withDiscount = '340',meanbuyprice = '340',meanbuyprice_withDiscount = '340' , productbuypricereal = '340' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='340',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='340',meanbuyprice_withTax='340',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='340',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2267';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2267', '1', '2026-10-20', '5', '0','0226701','340','0','0','340','','0','0','0','0','0','0','0','0','0','0'); -- id=2267
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2267', '1', '0', '5', '2026-10-20'); -- id=3660
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2267', '1', '0', '0', '2267', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15322
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2267, 1,'2026-10-20 16:23:26',5)
                ON DUPLICATE KEY UPDATE productid = 2267, edited = 1, sysdate = '2026-10-20 16:23:26', userid = 5; -- id=3320
UPDATE product SET productName = 'انترلوك مستورد كيمت اكس', productDescription = '', productCatId = '75', productBuyPrice = '340.00', productSellAllPrice = '340.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02267',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340',lastbuyprice_withDiscount = '340',meanbuyprice = '340',meanbuyprice_withDiscount = '340' , productbuypricereal = '340' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='340',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='340',meanbuyprice_withTax='340',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='340',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2267';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('ليجين كباسين كيمت اكس ','','75','395','395','0','0','2026-10-20','0','5','0','','0','0','0','0','0','395','395','395','395','395','0','0','0','0','.','0','0','0','395','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','395','395','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','395','0','0','0','0','0','0','','','0','0','0','0'); -- id=2268
UPDATE product SET productName = 'ليجين كباسين كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '395', productSellAllPrice = '395', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02268',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '395',meanbuyprice = '395',meanbuyprice_withDiscount = '395' , productbuypricereal = '395' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='395',meanbuyprice_withTax='395',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2268';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2268', '1', '2026-10-20', '5', '0','0226801','395','0','0','395','','0','0','0','0','0','0','0','0','0','0'); -- id=2268
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2268', '1', '0', '5', '2026-10-20'); -- id=3661
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2268', '1', '0', '0', '2268', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15323
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2268, 1,'2026-10-20 16:23:26',5)
                ON DUPLICATE KEY UPDATE productid = 2268, edited = 1, sysdate = '2026-10-20 16:23:26', userid = 5; -- id=3321
UPDATE product SET productName = 'ليجين كباسين كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '395.00', productSellAllPrice = '395.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02268',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '395',meanbuyprice = '395',meanbuyprice_withDiscount = '395' , productbuypricereal = '395' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='395',meanbuyprice_withTax='395',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2268';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:53:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:23:28", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:23:28', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15525
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:53:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:23:29", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:23:29', '5', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15526
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:54:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:24:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:24:30', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15527
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:54:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:24:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:24:37', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15528
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:54:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:24:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:24:41', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15529
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:54:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:24:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:24:48', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15530
UPDATE user SET loginip = "" WHERE userid = 6;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:55:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:25:33", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:25:33', '5', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15531
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 ('06ad76b517b8c8', '2026-10-20 16:23:29', '13', '-22732.00', '18231.5', '10', '1', '45515.00',  '40963.50', '0', '40963.5', '1', '2026-10-20 16:25:33', '', '5', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=267
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 ('02266', '267', '75', '2266', '52', '350', '18200.00', '0', '', '2026-10-20 16:25:33', '2266','','','0','0','0','0','0',null,'350','18200','0','0','0','0','0','0','0','0','1'); -- id=1490
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:23:29', 1, 2266, 0, 0
                    , 315, 52, 0, 0, 5, '2026-10-20 16:25:33')
                ON DUPLICATE KEY UPDATE buyprice = 315,
                        buyQuantity =buyQuantity+52, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 16:25:33' ; -- id=6748
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2266', '350', '52', '0', 'buyBillController.php', '1490', '', '0', '0'); -- id=1093
UPDATE product SET  productBuyPrice = "350" WHERE productId = 2266 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1490 ;
UPDATE product SET productName = 'جبردين جيب كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02266',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '315',meanbuyprice = '350',meanbuyprice_withDiscount = '315' , 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='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='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='315',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2266';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 315, meanbuyprice_withDiscount = 315
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 315
                where buybilldetailid = 1490;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2266;
UPDATE storedetail SET  productquantity = '52', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3659';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2266', '1', '52', '0', '267', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '52', '5', '2026-10-20 16:23:29','0','0'); -- id=15324
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 ('02267', '267', '75', '2267', '42', '340', '14280.00', '0', '', '2026-10-20 16:25:33', '2267','','','0','0','0','0','0',null,'340','14280','0','0','0','0','0','0','0','0','1'); -- id=1491
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:23:29', 1, 2267, 0, 0
                    , 306, 42, 0, 0, 5, '2026-10-20 16:25:33')
                ON DUPLICATE KEY UPDATE buyprice = 306,
                        buyQuantity =buyQuantity+42, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 16:25:33' ; -- id=6749
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2267', '340', '42', '0', 'buyBillController.php', '1491', '', '0', '0'); -- id=1094
UPDATE product SET  productBuyPrice = "340" WHERE productId = 2267 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1491 ;
UPDATE product SET productName = 'انترلوك مستورد كيمت اكس', productDescription = '', productCatId = '75', productBuyPrice = '340.00', productSellAllPrice = '340.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02267',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340',lastbuyprice_withDiscount = '306',meanbuyprice = '340',meanbuyprice_withDiscount = '306' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='340',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='340',meanbuyprice_withTax='340',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='306',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2267';
UPDATE buybilldetail SET  lastbuyprice = 340 , meanbuyprice = 340, lastbuyprice_withDiscount = 306, meanbuyprice_withDiscount = 306
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 306
                where buybilldetailid = 1491;
UPDATE productunit SET proUnitBuyPrice  = 340 * productnumber WHERE productid = 2267;
UPDATE storedetail SET  productquantity = '42', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3660';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2267', '1', '42', '0', '267', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '42', '5', '2026-10-20 16:23:29','0','0'); -- id=15325
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 ('02268', '267', '75', '2268', '33', '395', '13035.00', '0', '', '2026-10-20 16:25:33', '2268','','','0','0','0','0','0',null,'395','13035','0','0','0','0','0','0','0','0','1'); -- id=1492
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:23:29', 1, 2268, 0, 0
                    , 355.5, 33, 0, 0, 5, '2026-10-20 16:25:33')
                ON DUPLICATE KEY UPDATE buyprice = 355.5,
                        buyQuantity =buyQuantity+33, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 16:25:33' ; -- id=6750
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2268', '395', '33', '0', 'buyBillController.php', '1492', '', '0', '0'); -- id=1095
UPDATE product SET  productBuyPrice = "395" WHERE productId = 2268 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1492 ;
UPDATE product SET productName = 'ليجين كباسين كيمت اكس ', productDescription = '', productCatId = '75', productBuyPrice = '395.00', productSellAllPrice = '395.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02268',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '355.5',meanbuyprice = '395',meanbuyprice_withDiscount = '355.5' , productbuypricereal = '395.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='395',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='395',meanbuyprice_withTax='395',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='355.5',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2268';
UPDATE buybilldetail SET  lastbuyprice = 395 , meanbuyprice = 395, lastbuyprice_withDiscount = 355.5, meanbuyprice_withDiscount = 355.5
        , lastbuyprice_withTax = 395, meanbuyprice_withTax = 395, lastbuyprice_withDiscountAndTax = 355.5
                where buybilldetailid = 1492;
UPDATE productunit SET proUnitBuyPrice  = 395 * productnumber WHERE productid = 2268;
UPDATE storedetail SET  productquantity = '33', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3661';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2268', '1', '33', '0', '267', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '33', '5', '2026-10-20 16:23:29','0','0'); -- id=15326
UPDATE supplier SET  suppliercurrentDebt = '18231.5',suppliercurrentDebtInCurrency= '18231.5' , userid = '5', supplierdate = '2026-10-20 16:25:33'   WHERE supplierid = '13';
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 ('13', '-22732.00', '40963.5', '0', 'اضافة فاتورة مشتريات', '267', '18231.5', '2026-10-20 16:23:29', '5', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','40963.5','1','-22732','40963.5','18231.5','0',''); -- id=756
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '40963.5', '40963.5', '2026-10-20', '5', '0', '0', '2026-10-20 16:25:33','اضافة فاتورة مشتريات رقم 267','1','0',null,'0','267','buyBillController.php?do=details&id=267'); -- id=3987
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3987', '382', '40963.5', '','0'); -- id=4092
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23849651.09', 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 ('3987', '432', '40963.5', '','0'); -- id=3989
UPDATE accountstree SET name = 'كيميت اكس - مورد', customName = 'كيميت اكس - مورد', customNameEn = 'كيميت اكس - مورد', nameEn = 'كيميت اكس - مورد', parent = '81', accountNature = '1', theValue = '-213199.5', 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 = '432';
update buybill set dailyentryid='3987,0' where buybillid=267;
COMMIT;
UPDATE product SET overAllAveragePrice = 315 WHERE productId = 2266;UPDATE product SET overAllAveragePrice = 306 WHERE productId = 2267;UPDATE product SET overAllAveragePrice = 355.5 WHERE productId = 2268;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:55:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:25:33", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:25:33', '5', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=267'); -- id=15532
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:55:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:25:36", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:25:36', '5', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=267&type=2'); -- id=15533
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:55:39";
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-20 12:55:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:25:42", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:25:42', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15534
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-20 12:55:42";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 16:25:42", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:25:42', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15535
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:55:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:25:43", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:25:43', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15536
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-20 12:55:43";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 16:25:43", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:25:43', '6', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15537
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:55:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:25:50", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:25:50', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15538
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:56:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:26:45", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:26:45', '3', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15539

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad75ed6abd1f
-- ----------------------------------------------------------------------------------------------------

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-20 16:26:45', '06ad75ed6abd1f', '1', '0.00', '0', '0', '1', '9960.00', '9960', '9960', '0', '1', '2026-10-20 16:26:45', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '27' ,'0','','','','','-1','0','0','0','0','0','9960','0','','0','0','9960','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1123
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','اضافة فاتورة مبيعات','1123', '0', '2026-10-20 16:26:45', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '9960', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 16:26:45','0','0','',''); -- id=1342
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 82;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('378','01390', '1123', '95', '1390', '3', '420', '1260', '0', '', '0', '2026-10-20 16:26:45', '1390', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','82-3,','1','1','0','0','420','1260','0','','0','0.00','0','0','0','0'); -- id=4477
UPDATE sellbilldetail SET  lastbuyprice = 420.00 , meanbuyprice = 420.00, lastbuyprice_withDiscount = 378.00, meanbuyprice_withDiscount = 393.44
        , lastbuyprice_withTax = 420, meanbuyprice_withTax = 265.59, lastbuyprice_withDiscountAndTax = 378
                where sellbilldetailid = 4477;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1390, '2026-10-20', 1260, 1260, 1260
                    , 1260, 1134, 1180.32, 1134
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1260, 796.77, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1134, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1180.32
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1134
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+796.77
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1260, 1260, 1260
                    , 1260, 1134, 1180.32, 1134
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1260, 796.77, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1260, sellCostBuyPrice =sellCostBuyPrice+1260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1260
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1134, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1180.32
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1134
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+796.77
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '3', storedetaildate = '2026-10-20 16:26:45' WHERE storedetailid = '1390';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1390', '1', '3', '1', '1123', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '45', '3', '2026-10-20 16:26:45','0','0'); -- id=15327
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6548;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02235', '1123', '102', '2235', '6', '450', '2700', '0', '', '0', '2026-10-20 16:26:45', '2235', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6548-6,','1','1','0','0','450','2700','0','','0','0.00','0','0','0','0'); -- id=4478
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 = 4478;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2235, '2026-10-20', 2700, 2520, 2520
                    , 2520, 2520, 2520, 2520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2700, 2520, 2520
                    , 2520, 2520, 2520, 2520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2520, 2520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2700, sellCostBuyPrice =sellCostBuyPrice+2520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '3', storedetaildate = '2026-10-20 16:26:45' WHERE storedetailid = '3626';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2235', '1', '6', '1', '1123', 'اضافة فاتورة مبيعات', 'sellbillController.php', '12', '6', '3', '2026-10-20 16:26:45','0','0'); -- id=15328
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 511;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('460','01662', '1123', '124', '1662', '3', '500', '1500', '0', '', '0', '2026-10-20 16:26:45', '1662', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','511-3,','1','1','0','0','500','1500','0','','0','0.00','0','0','0','0'); -- id=4479
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 460
                where sellbilldetailid = 4479;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1662, '2026-10-20', 1500, 1500, 1500
                    , 1500, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1500, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 1500, 1500, 1500
                    , 1500, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1500, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '15', userid = '3', storedetaildate = '2026-10-20 16:26:45' WHERE storedetailid = '2674';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1662', '1', '3', '1', '1123', 'اضافة فاتورة مبيعات', 'sellbillController.php', '18', '15', '3', '2026-10-20 16:26:45','0','0'); -- id=15329
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6537;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','01841', '1123', '142', '1841', '3', '250', '750', '0', '', '0', '2026-10-20 16:26:45', '1841', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6537-3,','1','1','0','0','250','750','0','','0','0.00','0','0','0','0'); -- id=4480
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 4480;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1841, '2026-10-20', 750, 705, 705
                    , 705, 705, 705, 705
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 705, 690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+705
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+705, sellCostMeanBuyPrice = sellCostMeanBuyPrice+705
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+705, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+705
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+705
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+705
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+690
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 750, 705, 705
                    , 705, 705, 705, 705
                    , 0, 0, 0, 0
                    , 0, 0, 0, 705, 690, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+750, sellCostBuyPrice =sellCostBuyPrice+705
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+705, sellCostMeanBuyPrice = sellCostMeanBuyPrice+705
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+705, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+705
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+705
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+705
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+690
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '274', userid = '3', storedetaildate = '2026-10-20 16:26:45' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '3', '1', '1123', 'اضافة فاتورة مبيعات', 'sellbillController.php', '277', '274', '3', '2026-10-20 16:26:45','0','0'); -- id=15330
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6284;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('230','02175', '1123', '190', '2175', '6', '245', '1470', '0', '', '0', '2026-10-20 16:26:45', '2175', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6284-6,','1','1','0','0','245','1470','0','','0','0.00','0','0','0','0'); -- id=4481
UPDATE sellbilldetail SET  lastbuyprice = 230.00 , meanbuyprice = 230.00, lastbuyprice_withDiscount = 230.00, meanbuyprice_withDiscount = 230.00
        , lastbuyprice_withTax = 230, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 230
                where sellbilldetailid = 4481;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2175, '2026-10-20', 1470, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1470, 1380, 1380
                    , 1380, 1380, 1380, 1380
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1380, 1380, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1470, sellCostBuyPrice =sellCostBuyPrice+1380
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1380, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1380
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1380, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1380
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1380
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1380
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1380
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '3', storedetaildate = '2026-10-20 16:26:45' WHERE storedetailid = '3535';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2175', '1', '6', '1', '1123', 'اضافة فاتورة مبيعات', 'sellbillController.php', '25', '19', '3', '2026-10-20 16:26:45','0','0'); -- id=15331
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 274;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('342','01468', '1123', '105', '1468', '6', '380', '2280', '0', '', '0', '2026-10-20 16:26:45', '1468', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','274-6,','1','1','0','0','380','2280','0','','0','0.00','0','0','0','0'); -- id=4482
UPDATE sellbilldetail SET  lastbuyprice = 380.00 , meanbuyprice = 380.00, lastbuyprice_withDiscount = 342.00, meanbuyprice_withDiscount = 342.00
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 342
                where sellbilldetailid = 4482;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1468, '2026-10-20', 2280, 2280, 2280
                    , 2280, 2052, 2052, 2052
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2280, 2280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2280, sellCostBuyPrice =sellCostBuyPrice+2280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2052, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2052
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2052
                            , 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 (1, '2026-10-20', 2280, 2280, 2280
                    , 2280, 2052, 2052, 2052
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2280, 2280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2280, sellCostBuyPrice =sellCostBuyPrice+2280
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2280, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2280
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2052, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2052
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2052
                            , 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 = '81', userid = '3', storedetaildate = '2026-10-20 16:26:45' WHERE storedetailid = '1493';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1468', '1', '6', '1', '1123', 'اضافة فاتورة مبيعات', 'sellbillController.php', '87', '81', '3', '2026-10-20 16:26:45','0','0'); -- id=15332
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7012088.5',  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 ('7002128.5','9960', '0', '2', 'اضافة فاتورة مبيعات', '1123', '7012088.5', '2026-10-20 16:26:45', '3',  'sellbillController.php','1','','0'); -- id=1386
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '9960', '9960', '2026-10-20', '3', '0', '0', '2026-10-20 16:26:45','اضافة فاتورة مبيعات رقم 1123','1','0',null,'0','1123','sellbillController.php?do=showDetail&sellbillid=1123'); -- id=3988
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3988', '419', '9960', '','0'); -- id=4093
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7012088', 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 ('3988', '143', '9960', '','0'); -- id=3990
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12698845', 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 ( '9171', '9171', '2026-10-20', '3', '0', '0', '2026-10-20 16:26:45','اضافة فاتورة مبيعات رقم 1123 - صرف البضاعة من المخزن','1','0',null,'0','1123','sellbillController.php?do=showDetail&sellbillid=1123'); -- id=3989
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3989', '402', '9171', '','0'); -- id=4094
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11750136.61', 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 ('3989', '382', '9171', '','0'); -- id=3991
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23840480.09', 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='3988,0,3989' where sellbillid=1123;
 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-20', 9960, 9645, 9645
                    , 9645, 9171, 9217.32, 9171
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9645, 9166.77, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9960, sellCostBuyPrice =sellCostBuyPrice+9645
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9645, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9645
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9171, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9217.32
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9171
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9645
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9166.77
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 9960, 9645, 9645
                    , 9645, 9171, 9217.32, 9171
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,9645, 9166.77, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9960, sellCostBuyPrice =sellCostBuyPrice+9645
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9645, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9645
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9171, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9217.32
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9171
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9645
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9166.77
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 9960, 9645, 9645
                    , 9645, 9171, 9217.32, 9171, 9645, 9166.77)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+9960, netSellCostBuyPrice = netSellCostBuyPrice+9645
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+9645
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+9645
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+9171
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+9217.32
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+9171
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+9645
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+9166.77;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad75ed6abd1f and sellbillId = 1123 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:56:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:26:45", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:26:45', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15540
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:57:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:27:31", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:27:31', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15541

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad76bde83c1b
-- ----------------------------------------------------------------------------------------------------

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-20 16:27:31', '06ad76bde83c1b', '1', '0.00', '0', '0', '1', '2070.00', '2070', '2070', '0', '1', '2026-10-20 16:27:31', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '6' ,'0','','','','','-1','0','0','0','0','0','2070','0','','0','0','2070','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1124
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','1124', '0', '2026-10-20 16:27:31', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2070', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 16:27:31','0','0','',''); -- id=1343
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6479;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02203', '1124', '191', '2203', '6', '345', '2070', '0', '', '0', '2026-10-20 16:27:31', '2203', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6479-6,','1','1','0','0','345','2070','0','','0','0.00','0','0','0','0'); -- id=4483
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 = 4483;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2203, '2026-10-20', 2070, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2070, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2070, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2070, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '6', storedetaildate = '2026-10-20 16:27:31' WHERE storedetailid = '3592';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2203', '1', '6', '1', '1124', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '27', '6', '2026-10-20 16:27:31','0','0'); -- id=15333
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '944050',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('941980','2070', '0', '4', 'اضافة فاتورة مبيعات', '1124', '944050', '2026-10-20 16:27:31', '6',  'sellbillController.php','1','','0'); -- id=1387
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2070', '2070', '2026-10-20', '6', '0', '0', '2026-10-20 16:27:31','اضافة فاتورة مبيعات رقم 1124','1','0',null,'0','1124','sellbillController.php?do=showDetail&sellbillid=1124'); -- id=3990
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3990', '568', '2070', '','0'); -- id=4095
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '944050', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3990', '143', '2070', '','0'); -- id=3992
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12700915', 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 ( '1680', '1680', '2026-10-20', '6', '0', '0', '2026-10-20 16:27:31','اضافة فاتورة مبيعات رقم 1124 - صرف البضاعة من المخزن','1','0',null,'0','1124','sellbillController.php?do=showDetail&sellbillid=1124'); -- id=3991
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3991', '402', '1680', '','0'); -- id=4096
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11751816.61', 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 ('3991', '382', '1680', '','0'); -- id=3993
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23838800.09', 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='3990,0,3991' where sellbillid=1124;
 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-20', 2070, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2070, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2070, 1680, 1680
                    , 1680, 1680, 1680, 1680
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1680, 1680, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2070, sellCostBuyPrice =sellCostBuyPrice+1680
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1680, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1680
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1680, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1680
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1680
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1680
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1680
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 2070, 1680, 1680
                    , 1680, 1680, 1680, 1680, 1680, 1680)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2070, netSellCostBuyPrice = netSellCostBuyPrice+1680
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1680
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1680
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1680
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1680
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1680
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1680
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1680;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad76bde83c1b and sellbillId = 1124 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:57:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:27:31", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:27:31', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15542
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-20 12:57:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:27:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:27:33', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15543
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-20 12:57:33";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 16:27:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:27:33', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15544
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:57:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:27:35", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:27:35', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15545
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:58:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:28:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:28:53', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15546
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-20 12:58:54";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:28:54', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15547
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:29:17', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php'); -- id=15548
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:31", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:29:31', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15549
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:31", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:29:31', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15550
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:29:34', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=add'); -- id=15551
BEGIN;
CALL insertUniqueOptNum(22,2,1,1931,54,'2026-10-20',1,0, '' , '' ,0,0,0,0,0,'2026-10-20 16:29:34',0,'',0,'','hide',0,@id,@optnum);
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3085';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14', 2, 1931, 0, 0
                    , 350.00, 54, 0, 0, 1, '2026-10-20 16:29:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-54, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 16:29:34' ; -- id=1363
UPDATE storemovement SET  buyPricesHistoryBookData = "54*2026-10-14*350.00," WHERE transferproductid = 1419;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1931', '2', '54', '1', '1419', 'تحويل منتجات من المخزن', 'storemovementController.php', '54', '0', '1', '2026-10-20','0','0'); -- id=15334
UPDATE storedetail SET  productquantity = '54', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2948';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14', 1, 1931, 0, 0
                    , 350.00, 54, 0, 0, 1, '2026-10-20 16:29:34')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+54, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 16:29:34' ; -- id=1118
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1931', '1', '54', '0', '1419', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '0', '54', '1', '2026-10-20','0','0'); -- id=15335
UPDATE storedetail SET inUse = 0 WHERE storedetailid=3085;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=2948;
COMMIT;
BEGIN;
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '18900', '18900', '2026-10-20', '1', '0', '0', '2026-10-20 16:29:34','تحويل من مخزن مخزن المحل الى مخزن المخزن الرئيسي','1','0',null,'0','22','storemovementController.php?do=show&operationnum=22'); -- id=3992
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3992', '382', '18900', '','0'); -- id=4097
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23857700.09', 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 ('3992', '492', '18900', '','0'); -- id=3994
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1624611', 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';
COMMIT;
COMMIT;
UPDATE storemovement SET  dailyentryid =3992 WHERE operationnum = 22;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:29:34', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=sucess'); -- id=15552
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:34", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:29:34', '5', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=267&type=2'); -- id=15553
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:35", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:29:35', '5', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=267'); -- id=15554
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:29:35', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=15555
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:37", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:29:37', '5', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15556
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:38", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:29:38', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15557
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:38", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:29:38', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15558
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:29:43', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=15559
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:51", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:29:51', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=15560
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 12:59:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:29:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:29:57', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=15561
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:05', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=21'); -- id=15562
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:11", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:11', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=20'); -- id=15563
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:14";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:16', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=19'); -- id=15564
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:21', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=18'); -- id=15565
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:25', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=17'); -- id=15566
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:28', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=16'); -- id=15567
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:32', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=15'); -- id=15568
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:35', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=14'); -- id=15569
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:38', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=13'); -- id=15570
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:45', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=12'); -- id=15571
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:00:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:30:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:30:49', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=11'); -- id=15572
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:01:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:31:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:31:00', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=11'); -- id=15573
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-20 13:01:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:31:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:31:04', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=11'); -- id=15574
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-20 13:01:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:31:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:31:09', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=11'); -- id=15575
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:01:15";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 16:31:15", 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-20 13:01:15";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 16:31:15", deviceType = "DESKTOP" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:01:21";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 16:31:21", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:01:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:31:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:31:22', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=11'); -- id=15576
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:01:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:31:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:31:31', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=11'); -- id=15577
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:01:48";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('dailyentry.php', '2026-10-20 16:31:48', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/dailyentry.php?id=0'); -- id=15578
BEGIN;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:01:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:31:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:31:49', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15579
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-20 13:01:49";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:31:49', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15580
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:01:58";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 16:31:58", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:01:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:31:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:31:59', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=9'); -- id=15581
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 16:32:03', '1', 'editshowstyle2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=editshowstyle2&operationnum=8'); -- id=15582
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:16", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:32:16', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15583
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-20 16:32:16', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php'); -- id=15584
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-20 16:32:20', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=15585
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:21", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:32:21', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15586
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:23", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:32:23', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15587
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:25", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:32:25', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15588
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-20 13:02:25";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:32:25', '5', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15589
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:29", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-20 16:32:29', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php?do=show'); -- id=15590
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:30", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:32:30', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15591
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:39", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:32:39', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15592
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:02:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:32:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:32:40', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15593
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:03:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:33:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 16:33:12', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15594
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:03:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:33:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 16:33:17', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15595
UPDATE user SET loginip = "" WHERE userid = -1;
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:05:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:35:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:35:11', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15596
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-20 13:05:11";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 16:35:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:35:11', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15597
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:05:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:35:13", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:35:13', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15598
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:05:36";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 16:35:36", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:05:51";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 16:35:51", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:06:10";
UPDATE user SET loginip = "197.193.5.8", lastactivetime = "2026-10-20 16:36:10", deviceType = "MOBILE" WHERE userid = -1;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:07:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:37:54", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:37:54', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15599
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:08:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:38:48", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:38:48', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15600
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:09:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:39:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:39:06', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15601
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:10:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:40:23", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:40:23', '4', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15602

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad76d7768fa0
-- ----------------------------------------------------------------------------------------------------

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-20 16:40:23', '06ad76d7768fa0', '1', '0.00', '0', '0', '1', '8000.00', '8000', '8000', '0', '2', '2026-10-20 16:40:23', '', '4', '0', 'نقدي', '3', '0', '3', '0', 'نقدي', '20' ,'0','','','','','-1','0','0','0','0','0','8000','0','','0','0','8000','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1125
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','اضافة فاتورة مبيعات','1125', '0', '2026-10-20 16:40:23', '4', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8000', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 16:40:23','0','0','',''); -- id=1344
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 6735;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','02253', '1125', '197', '2253', '20', '400', '8000', '0', '', '0', '2026-10-20 16:40:23', '2253', '0.00', '-1', '2','0.00','','','0','0','0','0','0','0','0','0','','6735-20,','1','1','0','0','400','8000','0','','0','0.00','0','0','0','0'); -- id=4484
UPDATE sellbilldetail SET  lastbuyprice = 400.00 , meanbuyprice = 400.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 380.00
        , lastbuyprice_withTax = 400, meanbuyprice_withTax = 200, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 4484;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2253, '2026-10-20', 8000, 8000, 8000
                    , 8000, 7200, 7600, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 8000, 4000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8000, sellCostBuyPrice =sellCostBuyPrice+8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 8000, 8000, 8000
                    , 8000, 7200, 7600, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8000, 4000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8000, sellCostBuyPrice =sellCostBuyPrice+8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '4', storedetaildate = '2026-10-20 16:40:23' WHERE storedetailid = '3653';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2253', '2', '20', '1', '1125', 'اضافة فاتورة مبيعات', 'sellbillController.php', '64', '44', '4', '2026-10-20 16:40:23','0','0'); -- id=15336
CALL saveInUse(3,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '1120732.875',  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 ('1112732.875','8000', '0', '3', 'اضافة فاتورة مبيعات', '1125', '1120732.875', '2026-10-20 16:40:23', '4',  'sellbillController.php','1','','0'); -- id=1388
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8000', '8000', '2026-10-20', '4', '0', '0', '2026-10-20 16:40:23','اضافة فاتورة مبيعات رقم 1125','1','0',null,'0','1125','sellbillController.php?do=showDetail&sellbillid=1125'); -- id=3993
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3993', '501', '8000', '','0'); -- id=4098
UPDATE accountstree SET name = 'خزينه المحل الارضي', customName = 'خزينه المحل الارضي', customNameEn = 'خزينه المحل الارضي', nameEn = 'خزينه المحل الارضي', parent = '40', accountNature = '0', theValue = '1120732.9', 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 ('3993', '143', '8000', '','0'); -- id=3995
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12708915', 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 ( '7200', '7200', '2026-10-20', '4', '0', '0', '2026-10-20 16:40:23','اضافة فاتورة مبيعات رقم 1125 - صرف البضاعة من المخزن','1','0',null,'0','1125','sellbillController.php?do=showDetail&sellbillid=1125'); -- id=3994
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3994', '402', '7200', '','0'); -- id=4099
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11759016.61', 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 ('3994', '492', '7200', '','0'); -- id=3996
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1617411', 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='3993,0,3994' where sellbillid=1125;
 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-20', 8000, 8000, 8000
                    , 8000, 7200, 7600, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8000, 4000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8000, sellCostBuyPrice =sellCostBuyPrice+8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 8000, 8000, 8000
                    , 8000, 7200, 7600, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,8000, 4000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8000, sellCostBuyPrice =sellCostBuyPrice+8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7200
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 8000, 8000, 8000
                    , 8000, 7200, 7600, 7200, 8000, 4000)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8000, netSellCostBuyPrice = netSellCostBuyPrice+8000
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+8000
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+8000
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+7200
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+7600
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+7200
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+8000
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4000;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad76d7768fa0 and sellbillId = 1125 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:10:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:40:23", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:40:23', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15603
UPDATE product SET productName = 'موديل 395 كوين', productDescription = '', productCatId = '32', productBuyPrice = '380.00', productSellAllPrice = '395.00', productSellUnitPrice = '395.00', productSellHalfPrice = '395.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01517',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380.00',lastbuyprice_withDiscount = '380',meanbuyprice = '380.00',meanbuyprice_withDiscount = '380' , productbuypricereal = '380.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.95' , buyhalf_precentage = '3.95' , 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 = '1517';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1517, 1,'2026-10-20 16:41:48',5)
                ON DUPLICATE KEY UPDATE productid = 1517, edited = 1, sysdate = '2026-10-20 16:41:48', userid = 5; -- id=2311
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:11:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:41:52", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:41:52', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15604
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:14:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:44:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:44:01', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15605
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('ملتون شبابي سيفن ار','','71','300','300','0','0','2026-10-20','0','1','0','','0','0','0','0','0','300','300','300','300','300','0','0','0','0','.','0','0','0','300','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','300','300','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','300','0','0','0','0','0','0','','','0','0','0','0'); -- id=2269
UPDATE product SET productName = 'ملتون شبابي سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '300', productSellAllPrice = '300', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02269',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '300',lastbuyprice_withDiscount = '300',meanbuyprice = '300',meanbuyprice_withDiscount = '300' , productbuypricereal = '300' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='300',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='300',meanbuyprice_withTax='300',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='300',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2269';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2269', '1', '2026-10-20', '1', '0','0226901','300','0','0','300','','0','0','0','0','0','0','0','0','0','0'); -- id=2269
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2269', '1', '0', '1', '2026-10-20'); -- id=3662
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2269', '1', '0', '0', '2269', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15337
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2269, 1,'2026-10-20 16:44:01',1)
                ON DUPLICATE KEY UPDATE productid = 2269, edited = 1, sysdate = '2026-10-20 16:44:01', userid = 1; -- id=3323
UPDATE product SET productName = 'ملتون شبابي سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '300.00', productSellAllPrice = '300.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02269',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '300',lastbuyprice_withDiscount = '300',meanbuyprice = '300',meanbuyprice_withDiscount = '300' , productbuypricereal = '300' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='300',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='300',meanbuyprice_withTax='300',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='300',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2269';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديلات 330 سيفن ار','','71','330','330','0','0','2026-10-20','0','1','0','','0','0','0','0','0','330','330','330','330','330','0','0','0','0','.','0','0','0','330','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','330','330','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','330','0','0','0','0','0','0','','','0','0','0','0'); -- id=2270
UPDATE product SET productName = 'موديلات 330 سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '330', productSellAllPrice = '330', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02270',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '330',meanbuyprice_withDiscount = '330' , productbuypricereal = '330' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='330',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='330',meanbuyprice_withTax='330',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='330',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2270';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2270', '1', '2026-10-20', '1', '0','0227001','330','0','0','330','','0','0','0','0','0','0','0','0','0','0'); -- id=2270
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2270', '1', '0', '1', '2026-10-20'); -- id=3663
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2270', '1', '0', '0', '2270', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15338
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2270, 1,'2026-10-20 16:44:02',1)
                ON DUPLICATE KEY UPDATE productid = 2270, edited = 1, sysdate = '2026-10-20 16:44:02', userid = 1; -- id=3324
UPDATE product SET productName = 'موديلات 330 سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02270',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '330',meanbuyprice = '330',meanbuyprice_withDiscount = '330' , productbuypricereal = '330' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='330',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='330',meanbuyprice_withTax='330',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='330',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2270';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديلات 340 سيفن ار','','71','340','340','0','0','2026-10-20','0','1','0','','0','0','0','0','0','340','340','340','340','340','0','0','0','0','.','0','0','0','340','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','340','340','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','340','0','0','0','0','0','0','','','0','0','0','0'); -- id=2271
UPDATE product SET productName = 'موديلات 340 سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '340', productSellAllPrice = '340', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02271',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340',lastbuyprice_withDiscount = '340',meanbuyprice = '340',meanbuyprice_withDiscount = '340' , productbuypricereal = '340' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='340',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='340',meanbuyprice_withTax='340',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='340',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2271';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2271', '1', '2026-10-20', '1', '0','0227101','340','0','0','340','','0','0','0','0','0','0','0','0','0','0'); -- id=2271
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2271', '1', '0', '1', '2026-10-20'); -- id=3664
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2271', '1', '0', '0', '2271', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15339
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2271, 1,'2026-10-20 16:44:02',1)
                ON DUPLICATE KEY UPDATE productid = 2271, edited = 1, sysdate = '2026-10-20 16:44:02', userid = 1; -- id=3325
UPDATE product SET productName = 'موديلات 340 سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '340.00', productSellAllPrice = '340.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02271',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340',lastbuyprice_withDiscount = '340',meanbuyprice = '340',meanbuyprice_withDiscount = '340' , productbuypricereal = '340' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='340',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='340',meanbuyprice_withTax='340',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='340',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2271';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('وايد خاص سيفن ار','','71','350','350','0','0','2026-10-20','0','1','0','','0','0','0','0','0','350','350','350','350','350','0','0','0','0','.','0','0','0','350','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','350','350','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','350','0','0','0','0','0','0','','','0','0','0','0'); -- id=2272
UPDATE product SET productName = 'وايد خاص سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '350', productSellAllPrice = '350', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02272',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',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 = '',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='1',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 = '2272';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2272', '1', '2026-10-20', '1', '0','0227201','350','0','0','350','','0','0','0','0','0','0','0','0','0','0'); -- id=2272
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2272', '1', '0', '1', '2026-10-20'); -- id=3665
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2272', '1', '0', '0', '2272', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15340
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2272, 1,'2026-10-20 16:44:02',1)
                ON DUPLICATE KEY UPDATE productid = 2272, edited = 1, sysdate = '2026-10-20 16:44:02', userid = 1; -- id=3326
UPDATE product SET productName = 'وايد خاص سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02272',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',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 = '',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='1',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 = '2272';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('قصات سيفن ار','','71','360','360','0','0','2026-10-20','0','1','0','','0','0','0','0','0','360','360','360','360','360','0','0','0','0','.','0','0','0','360','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','360','360','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','360','0','0','0','0','0','0','','','0','0','0','0'); -- id=2273
UPDATE product SET productName = 'قصات سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '360', productSellAllPrice = '360', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02273',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2273';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2273', '1', '2026-10-20', '1', '0','0227301','360','0','0','360','','0','0','0','0','0','0','0','0','0','0'); -- id=2273
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2273', '1', '0', '1', '2026-10-20'); -- id=3666
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2273', '1', '0', '0', '2273', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15341
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2273, 1,'2026-10-20 16:44:02',1)
                ON DUPLICATE KEY UPDATE productid = 2273, edited = 1, sysdate = '2026-10-20 16:44:02', userid = 1; -- id=3327
UPDATE product SET productName = 'قصات سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02273',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2273';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('استك سيفن ار','','71','320','320','0','0','2026-10-20','0','1','0','','0','0','0','0','0','320','320','320','320','320','0','0','0','0','.','0','0','0','320','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','320','320','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','320','0','0','0','0','0','0','','','0','0','0','0'); -- id=2274
UPDATE product SET productName = 'استك سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '320', productSellAllPrice = '320', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02274',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320',meanbuyprice_withDiscount = '320' , productbuypricereal = '320' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='320',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='320',meanbuyprice_withTax='320',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='320',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2274';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2274', '1', '2026-10-20', '1', '0','0227401','320','0','0','320','','0','0','0','0','0','0','0','0','0','0'); -- id=2274
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2274', '1', '0', '1', '2026-10-20'); -- id=3667
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2274', '1', '0', '0', '2274', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15342
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2274, 1,'2026-10-20 16:44:02',1)
                ON DUPLICATE KEY UPDATE productid = 2274, edited = 1, sysdate = '2026-10-20 16:44:02', userid = 1; -- id=3328
UPDATE product SET productName = 'استك سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02274',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320',meanbuyprice_withDiscount = '320' , productbuypricereal = '320' , buypricereal_precentage = '0' , buytotal_precentage = '0' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='320',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='320',meanbuyprice_withTax='320',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='320',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2274';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:14:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:44:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:44:03', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15606
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:14:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:44:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:44:10', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15607
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:14:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:44:19", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:44:19', '5', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15608
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديل 410 كوين ','','74','395','410','0','0','2026-10-20','0','5','0','','0','0','0','0','0','395','395','395','395','395','0','3.8','0','0','.','0','0','0','395','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','395','395','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','395','0','0','0','0','0','0','','','0','0','0','0'); -- id=2275
UPDATE product SET productName = 'موديل 410 كوين ', productDescription = '', productCatId = '74', productBuyPrice = '395', productSellAllPrice = '410', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02275',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '395',meanbuyprice = '395',meanbuyprice_withDiscount = '395' , productbuypricereal = '395' , buypricereal_precentage = '0' , buytotal_precentage = '3.8' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='395',meanbuyprice_withTax='395',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2275';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2275', '1', '2026-10-20', '5', '0','0227501','410','0','0','395','','0','0','0','0','0','0','0','0','0','0'); -- id=2275
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2275', '1', '0', '5', '2026-10-20'); -- id=3668
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2275', '1', '0', '0', '2275', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15343
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2275, 1,'2026-10-20 16:44:19',5)
                ON DUPLICATE KEY UPDATE productid = 2275, edited = 1, sysdate = '2026-10-20 16:44:19', userid = 5; -- id=3329
UPDATE product SET productName = 'موديل 410 كوين ', productDescription = '', productCatId = '74', productBuyPrice = '395.00', productSellAllPrice = '410.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02275',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '395',meanbuyprice = '395',meanbuyprice_withDiscount = '395' , productbuypricereal = '395' , buypricereal_precentage = '0' , buytotal_precentage = '3.8' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='395',meanbuyprice_withTax='395',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2275';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديل 400 كوين ','','74','385','400','0','0','2026-10-20','0','5','0','','0','0','0','0','0','385','385','385','385','385','0','3.9','0','0','.','0','0','0','385','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','385','385','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','385','0','0','0','0','0','0','','','0','0','0','0'); -- id=2276
UPDATE product SET productName = 'موديل 400 كوين ', productDescription = '', productCatId = '74', productBuyPrice = '385', productSellAllPrice = '400', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02276',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '385',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '385' , buypricereal_precentage = '0' , buytotal_precentage = '3.9' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='385',meanbuyprice_withTax='385',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='385',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2276';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2276', '1', '2026-10-20', '5', '0','0227601','400','0','0','385','','0','0','0','0','0','0','0','0','0','0'); -- id=2276
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2276', '1', '0', '5', '2026-10-20'); -- id=3669
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2276', '1', '0', '0', '2276', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15344
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2276, 1,'2026-10-20 16:44:19',5)
                ON DUPLICATE KEY UPDATE productid = 2276, edited = 1, sysdate = '2026-10-20 16:44:19', userid = 5; -- id=3330
UPDATE product SET productName = 'موديل 400 كوين ', productDescription = '', productCatId = '74', productBuyPrice = '385.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02276',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '385',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '385' , buypricereal_precentage = '0' , buytotal_precentage = '3.9' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='385',meanbuyprice_withTax='385',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='385',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2276';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:14:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:44:20", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:44:20', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15609
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:14:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:44:22", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:44:22', '5', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15610
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:14:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:44:48", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:44:48', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15611
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-20 13:14:48";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:44:48', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15612
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:14:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:44:49", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:44:49', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15613
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-20 13:14:49";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:44:49', '3', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15614
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:45:01', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15615
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:45:08', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15616
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:14", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:45:14', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15617
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:14", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:45:14', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15618
UPDATE product SET productName = 'ملتون شبابي سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '300.00', productSellAllPrice = '300.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02269',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '300.00',lastbuyprice_withDiscount = '300',meanbuyprice = '300.00',meanbuyprice_withDiscount = '300' , productbuypricereal = '300.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='300',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='300',meanbuyprice_withTax='300',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='300',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2269';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2269, 1,'2026-10-20 16:45:19',1)
                ON DUPLICATE KEY UPDATE productid = 2269, edited = 1, sysdate = '2026-10-20 16:45:19', userid = 1; -- id=3323
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:21", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:45:21', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15619
UPDATE product SET productName = 'ملتون شبابي سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '300.00', productSellAllPrice = '300.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02269',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '300.00',lastbuyprice_withDiscount = '300',meanbuyprice = '300.00',meanbuyprice_withDiscount = '300' , productbuypricereal = '300.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='300',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='300',meanbuyprice_withTax='300',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='300',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2269';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2269, 1,'2026-10-20 16:45:21',1)
                ON DUPLICATE KEY UPDATE productid = 2269, edited = 1, sysdate = '2026-10-20 16:45:21', userid = 1; -- id=3323
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:45:22', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15620
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:25", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:45:25', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=991'); -- id=15621
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:36", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-20 16:45:36', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php'); -- id=15622
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:43", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('clientReportsController.php', '2026-10-20 16:45:43', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/clientReportsController.php?do=show'); -- id=15623
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:45:47', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15624
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-20 13:15:47";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 16:45:47", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:45:47', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15625
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:49", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:45:49', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15626
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:51";
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-20 13:15:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:55", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:45:55', '1', '', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15627
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-20 13:15:55";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:45:55', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15628
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:55", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:45:55', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15629

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad76e11bdf27
-- ----------------------------------------------------------------------------------------------------

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-20 16:45:55', '06ad76e11bdf27', '1', '0.00', '0', '45', '1', '10645.00', '10600', '10600', '0', '1', '2026-10-20 16:45:55', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '25' ,'0','','','','','-1','0','0','0','0','0','10600','0','','0','0','10600','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1126
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','اضافة فاتورة مبيعات','1126', '0', '2026-10-20 16:45:55', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '10600', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 16:45:55','0','0','',''); -- id=1345
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6515;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('391','02205', '1126', '187', '2205', '3', '425', '1275', '0', '', '0', '2026-10-20 16:45:55', '2205', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6515-3,','1','1','0','0','425','1275','0','','0','0.00','0','0','0','0'); -- id=4485
UPDATE sellbilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 425.00, lastbuyprice_withDiscount = 391.00, meanbuyprice_withDiscount = 391.00
        , lastbuyprice_withTax = 425, meanbuyprice_withTax = 425, lastbuyprice_withDiscountAndTax = 391
                where sellbilldetailid = 4485;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2205, '2026-10-20', 1269.6101456083, 1275, 1275
                    , 1275, 1173, 1173, 1173
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1275, 1275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1269.6101456083, sellCostBuyPrice =sellCostBuyPrice+1275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1173, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1173
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1173
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1269.6101456083, 1275, 1275
                    , 1275, 1173, 1173, 1173
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1275, 1275, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1269.6101456083, sellCostBuyPrice =sellCostBuyPrice+1275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1275
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1173, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1173
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1173
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1275
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 16:45:55' WHERE storedetailid = '3596';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2205', '1', '3', '1', '1126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '48', '45', '2', '2026-10-20 16:45:55','0','0'); -- id=15345
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6016;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450.8','02026', '1126', '166', '2026', '6', '490', '2940', '0', '', '0', '2026-10-20 16:45:55', '2026', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6016-6,','1','1','0','0','490','2940','0','','0','0.00','0','0','0','0'); -- id=4486
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 450.80, meanbuyprice_withDiscount = 450.80
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 450.8
                where sellbilldetailid = 4486;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2026, '2026-10-20', 2927.5716298732, 2940, 2940
                    , 2940, 2704.8, 2704.8, 2704.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2940, 2940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2927.5716298732, sellCostBuyPrice =sellCostBuyPrice+2940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2704.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2704.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2704.8
                            , 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+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-20', 2927.5716298732, 2940, 2940
                    , 2940, 2704.8, 2704.8, 2704.8
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2940, 2940, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2927.5716298732, sellCostBuyPrice =sellCostBuyPrice+2940
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2940, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2940
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2704.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2704.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2704.8
                            , 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 = '21', userid = '2', storedetaildate = '2026-10-20 16:45:55' WHERE storedetailid = '3385';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2026', '1', '6', '1', '1126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '21', '2', '2026-10-20 16:45:55','0','0'); -- id=15346
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 1118;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01931', '1126', '155', '1931', '3', '370', '1110', '0', '', '0', '2026-10-20 16:45:55', '1931', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1118-3,','1','1','0','0','370','1110','0','','0','0.00','0','0','0','0'); -- id=4487
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 175, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 4487;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1931, '2026-10-20', 1105.3076561766, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1050, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1105.3076561766, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1105.3076561766, 1050, 1050
                    , 1050, 1050, 1050, 1050
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1050, 525, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1105.3076561766, sellCostBuyPrice =sellCostBuyPrice+1050
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1050, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1050
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1050, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1050
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1050
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1050
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+525
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '51', userid = '2', storedetaildate = '2026-10-20 16:45:55' WHERE storedetailid = '2948';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1931', '1', '3', '1', '1126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '54', '51', '2', '2026-10-20 16:45:55','0','0'); -- id=15347
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 72;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01380', '1126', '94', '1380', '6', '390', '2340', '0', '', '0', '2026-10-20 16:45:55', '1380', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','72-6,','1','1','0','0','390','2340','0','','0','0.00','0','0','0','0'); -- id=4488
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 = 4488;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1380, '2026-10-20', 2330.1080319399, 2100, 2100
                    , 2100, 2100, 2100, 2100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2330.1080319399, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2330.1080319399, 2100, 2100
                    , 2100, 2100, 2100, 2100
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2330.1080319399, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2100, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2100
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2100
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '382', userid = '2', storedetaildate = '2026-10-20 16:45:55' WHERE storedetailid = '1380';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1380', '1', '6', '1', '1126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '388', '382', '2', '2026-10-20 16:45:55','0','0'); -- id=15348
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 235;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('320','01456', '1126', '94', '1456', '3', '360', '1080', '0', '', '0', '2026-10-20 16:45:55', '1456', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','235-3,','1','1','0','0','360','1080','0','','0','0.00','0','0','0','0'); -- id=4489
UPDATE sellbilldetail SET  lastbuyprice = 320.00 , meanbuyprice = 320.00, lastbuyprice_withDiscount = 320.00, meanbuyprice_withDiscount = 320.00
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where sellbilldetailid = 4489;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1456, '2026-10-20', 1075.4344762799, 960, 960
                    , 960, 960, 960, 960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 960, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1075.4344762799, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1075.4344762799, 960, 960
                    , 960, 960, 960, 960
                    , 0, 0, 0, 0
                    , 0, 0, 0, 960, 960, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1075.4344762799, sellCostBuyPrice =sellCostBuyPrice+960
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+960, sellCostMeanBuyPrice = sellCostMeanBuyPrice+960
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+960, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+960
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+960
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+960
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+960
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 16:45:55' WHERE storedetailid = '1481';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1456', '1', '3', '1', '1126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '27', '24', '2', '2026-10-20 16:45:55','0','0'); -- id=15349
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 1188;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','01984', '1126', '160', '1984', '3', '500', '1500', '0', '', '0', '2026-10-20 16:45:55', '1984', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1188-3,','1','1','0','0','500','1500','0','','0','0.00','0','0','0','0'); -- id=4490
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 4490;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1984, '2026-10-20', 1493.6589948333, 1500, 1500
                    , 1500, 1350, 1350, 1350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1493.6589948333, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+3
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 1493.6589948333, 1500, 1500
                    , 1500, 1350, 1350, 1350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1500, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1493.6589948333, sellCostBuyPrice =sellCostBuyPrice+1500
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1500, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1500
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1500
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '52', userid = '2', storedetaildate = '2026-10-20 16:45:55' WHERE storedetailid = '3001';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1984', '1', '3', '1', '1126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '55', '52', '2', '2026-10-20 16:45:55','0','0'); -- id=15350
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','01382', '1126', '94', '1382', '1', '400', '400', '0', '', '0', '2026-10-20 16:45:55', '1382', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','400','400','0','','0','0.00','0','0','0','0'); -- id=4491
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 4491;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1382, '2026-10-20', 398.30906528887, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+398.30906528887, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 398.30906528887, 360, 360
                    , 360, 360, 360, 360
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+398.30906528887, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+360, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+360
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+360
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '2', userid = '2', storedetaildate = '2026-10-20 16:45:55' WHERE storedetailid = '1382';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1382', '1', '1', '1', '1126', 'اضافة فاتورة مبيعات', 'sellbillController.php', '3', '2', '2', '2026-10-20 16:45:55','0','0'); -- id=15351
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7022688.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('7012088.5','10600', '0', '2', 'اضافة فاتورة مبيعات', '1126', '7022688.5', '2026-10-20 16:45:55', '2',  'sellbillController.php','1','','0'); -- id=1389
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10645', '10645', '2026-10-20', '2', '0', '0', '2026-10-20 16:45:55','اضافة فاتورة مبيعات رقم 1126','1','0',null,'0','1126','sellbillController.php?do=showDetail&sellbillid=1126'); -- id=3995
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3995', '419', '10600', '','0'); -- id=4100
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7022688', 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 ('3995', '398', '45', '','0'); -- id=4101
UPDATE accountstree SET name = 'خصم مسموح به', customName = 'خصم مسموح به', customNameEn = '', nameEn = '', parent = '158', accountNature = '0', theValue = '510159.1', 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 ('3995', '143', '10645', '','0'); -- id=3997
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12719560', 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 ( '9697.8', '9697.8', '2026-10-20', '2', '0', '0', '2026-10-20 16:45:55','اضافة فاتورة مبيعات رقم 1126 - صرف البضاعة من المخزن','1','0',null,'0','1126','sellbillController.php?do=showDetail&sellbillid=1126'); -- id=3996
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3996', '402', '9697.8', '','0'); -- id=4102
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11768714.41', 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 ('3996', '382', '9697.8', '','0'); -- id=3998
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23848002.29', 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='3995,0,3996' where sellbillid=1126;
 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-20', 10600, 10185, 10185
                    , 10185, 9697.8, 9697.8, 9697.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10185, 9660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10600, sellCostBuyPrice =sellCostBuyPrice+10185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9697.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9697.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9697.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9660
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 10600, 10185, 10185
                    , 10185, 9697.8, 9697.8, 9697.8
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,10185, 9660, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10600, sellCostBuyPrice =sellCostBuyPrice+10185
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10185, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10185
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9697.8, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9697.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9697.8
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10185
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9660
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 10600, 10185, 10185
                    , 10185, 9697.8, 9697.8, 9697.8, 10185, 9660)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+10600, netSellCostBuyPrice = netSellCostBuyPrice+10185
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+10185
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+10185
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+9697.8
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+9697.8
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+9697.8
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+10185
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+9660;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad76e11bdf27 and sellbillId = 1126 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:45:56', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15630
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:15:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:45:58", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 16:45:58', '1', 'oneSupplier', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15631
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:16:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:46:20", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 16:46:20', '1', 'oneSupplier', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15632
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:16:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:46:39", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:46:39', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15633
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:16:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:46:39", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:46:39', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15634
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:16:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:46:42", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:46:42', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15635
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:16:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:46:46", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:46:46', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15636
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:16:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:46:53", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:46:53', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=992'); -- id=15637
UPDATE product SET productName = 'موديلات 330 سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02270',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330.00',lastbuyprice_withDiscount = '330',meanbuyprice = '330.00',meanbuyprice_withDiscount = '330' , productbuypricereal = '330.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='330',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='330',meanbuyprice_withTax='330',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='330',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2270';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2270, 1,'2026-10-20 16:46:56',1)
                ON DUPLICATE KEY UPDATE productid = 2270, edited = 1, sysdate = '2026-10-20 16:46:56', userid = 1; -- id=3324
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:16:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:46:57", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:46:57', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15638
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:00", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:00', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15639
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:00", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:00', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15640
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:07', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15641
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:12", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:47:12', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=993'); -- id=15642
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:16", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:16', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15643
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:17", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:17', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15644
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:19", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:47:19', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15645
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:23", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:23', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15646
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:27", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:47:27', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=994'); -- id=15647
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:29", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storereportController.php', '2026-10-20 16:47:29', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storereportController.php'); -- id=15648
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:31", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:31', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15649
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:32", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:32', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15650
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:32", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:47:32', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15651
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:38", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:38', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15652
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:42";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:42", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:47:42', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=995'); -- id=15653
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:44", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:47:44', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15654
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:52", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:52', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15655
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:52", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:52', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15656
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:17:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:47:58", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:47:58', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15657
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:03", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:48:03', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1003'); -- id=15658
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:48:07', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15659
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:48:07', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15660
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:13", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:48:13', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15661
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:20", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:48:20', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=998'); -- id=15662
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:25", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:48:25', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15663
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:25", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:48:25', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15664
UPDATE product SET productName = 'موديلات 330 سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02270',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330.00',lastbuyprice_withDiscount = '330',meanbuyprice = '330.00',meanbuyprice_withDiscount = '330' , productbuypricereal = '330.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='330',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='330',meanbuyprice_withTax='330',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='330',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2270';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2270, 1,'2026-10-20 16:48:26',1)
                ON DUPLICATE KEY UPDATE productid = 2270, edited = 1, sysdate = '2026-10-20 16:48:26', userid = 1; -- id=3324
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:27", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:48:27', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15665
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:31", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:48:31', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15666
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:50", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:48:50', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1085'); -- id=15667
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:57", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:48:57', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15668
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:18:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:48:58", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:48:58', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15669
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:19:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:49:06", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:49:06', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15670
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:19:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:49:14", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:49:14', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15671
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:19:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:49:53", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:49:53', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15672
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:20:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:50:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2026-10-20 16:50:07', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnsellbillController.php?do=showDetail&returnsellbillid=33'); -- id=15673
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:20:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:50:31", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:50:31', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15674
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:09", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 16:51:09', '1', 'oneSupplier', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15675
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:11", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:51:11', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1081'); -- id=15676
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-20 13:21:15";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:15", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:51:15', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15677
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:15", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:51:15', '1', '', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15678
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-20 13:21:15";
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:15", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:51:15', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15679
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:51:15', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15680
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:19", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 16:51:19', '1', 'oneSupplier', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15681
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:21", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:51:21', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1099'); -- id=15682
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:25", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:51:25', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15683
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:26", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:51:26', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15684
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:32", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:51:32', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15685
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:33", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:51:33', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15686
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:40", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 16:51:40', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15687
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:48";
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-20 13:21:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:52", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 16:51:52', '1', '', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15688
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-20 13:21:52";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 16:51:52', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15689
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:21:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:51:54", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 16:51:54', '1', '', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15690
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:22:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:52:14", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 16:52:14', '1', 'show', '41.42.136.168', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15691
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:22:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:52:39", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:52:39', '5', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15692
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديل 410 كوين ','','32','395','410','0','0','2026-10-20','0','5','0','','0','0','0','0','0','395','395','395','395','395','0','3.8','0','0','.','0','0','0','395','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','395','395','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','395','0','0','0','0','0','0','','','0','0','0','0'); -- id=2277
UPDATE product SET productName = 'موديل 410 كوين ', productDescription = '', productCatId = '32', productBuyPrice = '395', productSellAllPrice = '410', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02277',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '395',meanbuyprice = '395',meanbuyprice_withDiscount = '395' , productbuypricereal = '395' , buypricereal_precentage = '0' , buytotal_precentage = '3.8' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='395',meanbuyprice_withTax='395',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2277';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2277', '1', '2026-10-20', '5', '0','0227701','410','0','0','395','','0','0','0','0','0','0','0','0','0','0'); -- id=2277
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2277', '1', '0', '5', '2026-10-20'); -- id=3670
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2277', '1', '0', '0', '2277', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15352
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2277, 1,'2026-10-20 16:52:39',5)
                ON DUPLICATE KEY UPDATE productid = 2277, edited = 1, sysdate = '2026-10-20 16:52:39', userid = 5; -- id=3335
UPDATE product SET productName = 'موديل 410 كوين ', productDescription = '', productCatId = '32', productBuyPrice = '395.00', productSellAllPrice = '410.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02277',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '395',meanbuyprice = '395',meanbuyprice_withDiscount = '395' , productbuypricereal = '395' , buypricereal_precentage = '0' , buytotal_precentage = '3.8' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='395',meanbuyprice_withTax='395',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2277';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('موديل 400 كوين ','','32','385','400','0','0','2026-10-20','0','5','0','','0','0','0','0','0','385','385','385','385','385','0','3.9','0','0','.','0','0','0','385','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','385','385','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','385','0','0','0','0','0','0','','','0','0','0','0'); -- id=2278
UPDATE product SET productName = 'موديل 400 كوين ', productDescription = '', productCatId = '32', productBuyPrice = '385', productSellAllPrice = '400', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02278',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '385',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '385' , buypricereal_precentage = '0' , buytotal_precentage = '3.9' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='385',meanbuyprice_withTax='385',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='385',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2278';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2278', '1', '2026-10-20', '5', '0','0227801','400','0','0','385','','0','0','0','0','0','0','0','0','0','0'); -- id=2278
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2278', '1', '0', '5', '2026-10-20'); -- id=3671
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2278', '1', '0', '0', '2278', 'إضافة منتج', 'productController.php', '0', '0', '5', '2026-10-20','0','0'); -- id=15353
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2278, 1,'2026-10-20 16:52:39',5)
                ON DUPLICATE KEY UPDATE productid = 2278, edited = 1, sysdate = '2026-10-20 16:52:39', userid = 5; -- id=3336
UPDATE product SET productName = 'موديل 400 كوين ', productDescription = '', productCatId = '32', productBuyPrice = '385.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02278',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '385',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '385' , buypricereal_precentage = '0' , buytotal_precentage = '3.9' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='385',meanbuyprice_withTax='385',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='385',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2278';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:22:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:52:41", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:52:41', '5', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15693
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:22:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:52:41", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:52:41', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15694
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:22:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:52:52", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:52:52', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15695
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:22:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:52:59", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:52:59', '5', 'deleteFinaly', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=deleteFinaly&id=2275&optic=0'); -- id=15696
BEGIN;
UPDATE product SET productName = 'موديل 410 كوين ', productDescription = '', productCatId = '74', productBuyPrice = '395.00', productSellAllPrice = '410.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '2', userId = '5', limitamount = '0', parcode = '02275',type ='0', expireDate = '0' , dailyentryId = null,isService = '0',isOptic = '0',lastbuyprice = '395.00',lastbuyprice_withDiscount = '395',meanbuyprice = '395.00',meanbuyprice_withDiscount = '395' , productbuypricereal = '395.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.80' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',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='395',meanbuyprice_withTax='395',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2275';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2275, 2,'2026-10-20 16:52:59',5)
                ON DUPLICATE KEY UPDATE productid = 2275, edited = 2, sysdate = '2026-10-20 16:52:59', userid = 5; -- id=3329
DELETE FROM productingredients WHERE productId = '2275';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:22:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:52:59", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:52:59', '5', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=sucess'); -- id=15697
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:23:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:53:01", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:53:01', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15698
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:23:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:53:03", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:53:03', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15699
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:23:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:53:15", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:53:15', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15700
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:23:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:53:18", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:53:18', '6', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15701

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad76c437695a
-- ----------------------------------------------------------------------------------------------------

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-20 16:53:18', '06ad76c437695a', '1', '0.00', '0', '0', '1', '1395.00', '1395', '1395', '0', '1', '2026-10-20 16:53:18', '', '6', '0', 'نقدي', '4', '0', '3', '0', 'نقدي', '3' ,'0','','','','','-1','0','0','0','0','0','1395','0','','0','0','1395','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1127
UPDATE client SET  clientdebt = '0', userid = '6' 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','اضافة فاتورة مبيعات','1127', '0', '2026-10-20 16:53:18', '6', 'sellbillController.php', 'اضافة فاتورة مبيعات', '1395', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 16:53:18','0','0','',''); -- id=1346
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 6723;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','02260', '1127', '199', '2260', '3', '465', '1395', '0', '', '0', '2026-10-20 16:53:18', '2260', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6723-3,','1','1','0','0','465','1395','0','','0','0.00','0','0','0','0'); -- id=4492
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 4492;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2260, '2026-10-20', 1395, 1350, 1350
                    , 1350, 1350, 1350, 1350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1395, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1395, 1350, 1350
                    , 1350, 1350, 1350, 1350
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1395, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '6', storedetaildate = '2026-10-20 16:53:18' WHERE storedetailid = '3651';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2260', '1', '3', '1', '1127', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '36', '6', '2026-10-20 16:53:18','0','0'); -- id=15354
CALL saveInUse(4,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '945445',  userid = '6' WHERE saveid = '4';
UPDATE save SET  inUse = 0 where saveid = 4;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('944050','1395', '0', '4', 'اضافة فاتورة مبيعات', '1127', '945445', '2026-10-20 16:53:18', '6',  'sellbillController.php','1','','0'); -- id=1390
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '1395', '1395', '2026-10-20', '6', '0', '0', '2026-10-20 16:53:18','اضافة فاتورة مبيعات رقم 1127','1','0',null,'0','1127','sellbillController.php?do=showDetail&sellbillid=1127'); -- id=3997
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3997', '568', '1395', '','0'); -- id=4103
UPDATE accountstree SET name = 'خزنة شروال', customName = 'خزنة شروال', customNameEn = 'خزنة شروال', nameEn = 'خزنة شروال', parent = '40', accountNature = '0', theValue = '945445', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 13:37:54' WHERE id = '568';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3997', '143', '1395', '','0'); -- id=3999
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12720955', 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 ( '1350', '1350', '2026-10-20', '6', '0', '0', '2026-10-20 16:53:18','اضافة فاتورة مبيعات رقم 1127 - صرف البضاعة من المخزن','1','0',null,'0','1127','sellbillController.php?do=showDetail&sellbillid=1127'); -- id=3998
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3998', '402', '1350', '','0'); -- id=4104
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11770064.41', 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 ('3998', '382', '1350', '','0'); -- id=4000
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '23846652.29', 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='3997,0,3998' where sellbillid=1127;
 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-20', 1395, 1350, 1350
                    , 1350, 1350, 1350, 1350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1395, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1395, 1350, 1350
                    , 1350, 1350, 1350, 1350
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,1350, 1350, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1395, sellCostBuyPrice =sellCostBuyPrice+1350
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1350, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1350
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1350, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1350
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1350
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1350
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1350
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 1395, 1350, 1350
                    , 1350, 1350, 1350, 1350, 1350, 1350)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+1395, netSellCostBuyPrice = netSellCostBuyPrice+1350
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+1350
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+1350
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+1350
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+1350
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+1350
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+1350
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+1350;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad76c437695a and sellbillId = 1127 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:23:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:53:18", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:53:18', '6', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15702
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:23:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:53:20", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:53:20', '5', 'deleteFinaly', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=deleteFinaly&id=2276&optic=0'); -- id=15703
BEGIN;
UPDATE product SET productName = 'موديل 400 كوين ', productDescription = '', productCatId = '74', productBuyPrice = '385.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '2', userId = '5', limitamount = '0', parcode = '02276',type ='0', expireDate = '0' , dailyentryId = null,isService = '0',isOptic = '0',lastbuyprice = '385.00',lastbuyprice_withDiscount = '385',meanbuyprice = '385.00',meanbuyprice_withDiscount = '385' , productbuypricereal = '385.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.90' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='385',meanbuyprice_withTax='385',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='385',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2276';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2276, 2,'2026-10-20 16:53:20',5)
                ON DUPLICATE KEY UPDATE productid = 2276, edited = 2, sysdate = '2026-10-20 16:53:20', userid = 5; -- id=3330
DELETE FROM productingredients WHERE productId = '2276';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:23:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:53:20", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:53:20', '5', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=sucess'); -- id=15704
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:23:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:53:22", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:53:22', '5', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15705
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:23:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:53:23", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:53:23', '5', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15706
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:24:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:54:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:54:03', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15707
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 ('06ad77072627ce', '2026-10-20 16:45:22', '25', '8495.00', '169127', '8', '1', '174600.00',  '160632.00', '0', '160632', '1', '2026-10-20 16:54:03', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=268
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 ('02269', '268', '71', '2269', '72', '300', '21600.00', '0', '', '2026-10-20 16:54:03', '2269','','','0','0','0','0','0',null,'300','21600','0','0','0','0','0','0','0','0','1'); -- id=1493
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:45:22', 1, 2269, 0, 0
                    , 276, 72, 0, 0, 1, '2026-10-20 16:54:03')
                ON DUPLICATE KEY UPDATE buyprice = 276,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 16:54:03' ; -- id=6753
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2269', '300', '72', '0', 'buyBillController.php', '1493', '', '0', '0'); -- id=1096
UPDATE product SET  productBuyPrice = "300" WHERE productId = 2269 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1493 ;
UPDATE product SET productName = 'ملتون شبابي سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '300.00', productSellAllPrice = '300.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02269',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '300',lastbuyprice_withDiscount = '276',meanbuyprice = '300',meanbuyprice_withDiscount = '276' , productbuypricereal = '300.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='300',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='300',meanbuyprice_withTax='300',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='276',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2269';
UPDATE buybilldetail SET  lastbuyprice = 300 , meanbuyprice = 300, lastbuyprice_withDiscount = 276, meanbuyprice_withDiscount = 276
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 276
                where buybilldetailid = 1493;
UPDATE productunit SET proUnitBuyPrice  = 300 * productnumber WHERE productid = 2269;
UPDATE storedetail SET  productquantity = '72', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3662';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2269', '1', '72', '0', '268', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '72', '1', '2026-10-20 16:45:22','0','0'); -- id=15355
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 ('02270', '268', '71', '2270', '60', '330', '19800.00', '0', '', '2026-10-20 16:54:03', '2270','','','0','0','0','0','0',null,'330','19800','0','0','0','0','0','0','0','0','1'); -- id=1494
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:45:22', 1, 2270, 0, 0
                    , 303.6, 60, 0, 0, 1, '2026-10-20 16:54:03')
                ON DUPLICATE KEY UPDATE buyprice = 303.6,
                        buyQuantity =buyQuantity+60, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 16:54:03' ; -- id=6754
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2270', '330', '60', '0', 'buyBillController.php', '1494', '', '0', '0'); -- id=1097
UPDATE product SET  productBuyPrice = "330" WHERE productId = 2270 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1494 ;
UPDATE product SET productName = 'موديلات 330 سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02270',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '303.6',meanbuyprice = '330',meanbuyprice_withDiscount = '303.6' , productbuypricereal = '330.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='330',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='330',meanbuyprice_withTax='330',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='303.6',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2270';
UPDATE buybilldetail SET  lastbuyprice = 330 , meanbuyprice = 330, lastbuyprice_withDiscount = 303.6, meanbuyprice_withDiscount = 303.6
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 303.6
                where buybilldetailid = 1494;
UPDATE productunit SET proUnitBuyPrice  = 330 * productnumber WHERE productid = 2270;
UPDATE storedetail SET  productquantity = '60', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3663';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2270', '1', '60', '0', '268', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '60', '1', '2026-10-20 16:45:22','0','0'); -- id=15356
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 ('02271', '268', '71', '2271', '64', '340', '21760.00', '0', '', '2026-10-20 16:54:03', '2271','','','0','0','0','0','0',null,'340','21760','0','0','0','0','0','0','0','0','1'); -- id=1495
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:45:22', 1, 2271, 0, 0
                    , 312.8, 64, 0, 0, 1, '2026-10-20 16:54:03')
                ON DUPLICATE KEY UPDATE buyprice = 312.8,
                        buyQuantity =buyQuantity+64, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 16:54:03' ; -- id=6755
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2271', '340', '64', '0', 'buyBillController.php', '1495', '', '0', '0'); -- id=1098
UPDATE product SET  productBuyPrice = "340" WHERE productId = 2271 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1495 ;
UPDATE product SET productName = 'موديلات 340 سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '340.00', productSellAllPrice = '340.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02271',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340',lastbuyprice_withDiscount = '312.8',meanbuyprice = '340',meanbuyprice_withDiscount = '312.8' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='340',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='340',meanbuyprice_withTax='340',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='312.8',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2271';
UPDATE buybilldetail SET  lastbuyprice = 340 , meanbuyprice = 340, lastbuyprice_withDiscount = 312.8, meanbuyprice_withDiscount = 312.8
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 312.8
                where buybilldetailid = 1495;
UPDATE productunit SET proUnitBuyPrice  = 340 * productnumber WHERE productid = 2271;
UPDATE storedetail SET  productquantity = '64', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3664';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2271', '1', '64', '0', '268', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '64', '1', '2026-10-20 16:45:22','0','0'); -- id=15357
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 ('02271', '268', '71', '2271', '68', '340', '23120.00', '0', '', '2026-10-20 16:54:03', '2271','','','0','0','0','0','0',null,'340','23120','0','0','0','0','0','0','0','0','1'); -- id=1496
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:45:22', 1, 2271, 0, 0
                    , 312.8, 68, 0, 0, 1, '2026-10-20 16:54:03')
                ON DUPLICATE KEY UPDATE buyprice = 312.8,
                        buyQuantity =buyQuantity+68, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 16:54:03' ; -- id=6755
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2271', '340', '68', '0', 'buyBillController.php', '1496', '', '0', '0'); -- id=1099
UPDATE product SET  productBuyPrice = "340" WHERE productId = 2271 ;
UPDATE buybilldetail SET  quantitybefore = 64 WHERE buybilldetailid = 1496 ;
UPDATE product SET productName = 'موديلات 340 سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '340.00', productSellAllPrice = '340.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02271',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '340',lastbuyprice_withDiscount = '312.8',meanbuyprice = '340',meanbuyprice_withDiscount = '312.8' , productbuypricereal = '340.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='340',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='340',meanbuyprice_withTax='340',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='312.8',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2271';
UPDATE buybilldetail SET  lastbuyprice = 340 , meanbuyprice = 340, lastbuyprice_withDiscount = 312.8, meanbuyprice_withDiscount = 312.8
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 312.8
                where buybilldetailid = 1496;
UPDATE productunit SET proUnitBuyPrice  = 340 * productnumber WHERE productid = 2271;
UPDATE storedetail SET  productquantity = '132', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3664';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2271', '1', '68', '0', '268', 'اضافة فاتورة مشتريات', 'buyBillController.php', '64', '132', '1', '2026-10-20 16:45:22','0','0'); -- id=15358
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 ('02272', '268', '71', '2272', '64', '350', '22400.00', '0', '', '2026-10-20 16:54:03', '2272','','','0','0','0','0','0',null,'350','22400','0','0','0','0','0','0','0','0','1'); -- id=1497
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:45:22', 1, 2272, 0, 0
                    , 322, 64, 0, 0, 1, '2026-10-20 16:54:03')
                ON DUPLICATE KEY UPDATE buyprice = 322,
                        buyQuantity =buyQuantity+64, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 16:54:03' ; -- id=6757
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2272', '350', '64', '0', 'buyBillController.php', '1497', '', '0', '0'); -- id=1100
UPDATE product SET  productBuyPrice = "350" WHERE productId = 2272 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1497 ;
UPDATE product SET productName = 'وايد خاص سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '350.00', productSellAllPrice = '350.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02272',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '322',meanbuyprice = '350',meanbuyprice_withDiscount = '322' , 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='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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='322',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2272';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 322, meanbuyprice_withDiscount = 322
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 322
                where buybilldetailid = 1497;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2272;
UPDATE storedetail SET  productquantity = '64', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3665';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2272', '1', '64', '0', '268', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '64', '1', '2026-10-20 16:45:22','0','0'); -- id=15359
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 ('02273', '268', '71', '2273', '64', '360', '23040.00', '0', '', '2026-10-20 16:54:03', '2273','','','0','0','0','0','0',null,'360','23040','0','0','0','0','0','0','0','0','1'); -- id=1498
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:45:22', 1, 2273, 0, 0
                    , 331.2, 64, 0, 0, 1, '2026-10-20 16:54:03')
                ON DUPLICATE KEY UPDATE buyprice = 331.2,
                        buyQuantity =buyQuantity+64, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 16:54:03' ; -- id=6758
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2273', '360', '64', '0', 'buyBillController.php', '1498', '', '0', '0'); -- id=1101
UPDATE product SET  productBuyPrice = "360" WHERE productId = 2273 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1498 ;
UPDATE product SET productName = 'قصات سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '360.00', productSellAllPrice = '360.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02273',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '331.2',meanbuyprice = '360',meanbuyprice_withDiscount = '331.2' , productbuypricereal = '360.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='360',meanbuyprice_withTax='360',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='331.2',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2273';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 331.2, meanbuyprice_withDiscount = 331.2
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 331.2
                where buybilldetailid = 1498;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2273;
UPDATE storedetail SET  productquantity = '64', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3666';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2273', '1', '64', '0', '268', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '64', '1', '2026-10-20 16:45:22','0','0'); -- id=15360
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 ('02274', '268', '71', '2274', '68', '320', '21760.00', '0', '', '2026-10-20 16:54:03', '2274','','','0','0','0','0','0',null,'320','21760','0','0','0','0','0','0','0','0','1'); -- id=1499
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:45:22', 1, 2274, 0, 0
                    , 294.4, 68, 0, 0, 1, '2026-10-20 16:54:03')
                ON DUPLICATE KEY UPDATE buyprice = 294.4,
                        buyQuantity =buyQuantity+68, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 16:54:03' ; -- id=6759
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2274', '320', '68', '0', 'buyBillController.php', '1499', '', '0', '0'); -- id=1102
UPDATE product SET  productBuyPrice = "320" WHERE productId = 2274 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1499 ;
UPDATE product SET productName = 'استك سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '320.00', productSellAllPrice = '320.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02274',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '294.4',meanbuyprice = '320',meanbuyprice_withDiscount = '294.4' , productbuypricereal = '320.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='320',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='320',meanbuyprice_withTax='320',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='294.4',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2274';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 294.4, meanbuyprice_withDiscount = 294.4
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 294.4
                where buybilldetailid = 1499;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2274;
UPDATE storedetail SET  productquantity = '68', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3667';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2274', '1', '68', '0', '268', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '68', '1', '2026-10-20 16:45:22','0','0'); -- id=15361
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 ('02270', '268', '71', '2270', '64', '330', '21120.00', '0', '', '2026-10-20 16:54:03', '2270','','','0','0','0','0','0',null,'330','21120','0','0','0','0','0','0','0','0','1'); -- id=1500
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:45:22', 1, 2270, 0, 0
                    , 303.6, 64, 0, 0, 1, '2026-10-20 16:54:03')
                ON DUPLICATE KEY UPDATE buyprice = 303.6,
                        buyQuantity =buyQuantity+64, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 16:54:03' ; -- id=6754
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2270', '330', '64', '0', 'buyBillController.php', '1500', '', '0', '0'); -- id=1103
UPDATE product SET  productBuyPrice = "330" WHERE productId = 2270 ;
UPDATE buybilldetail SET  quantitybefore = 60 WHERE buybilldetailid = 1500 ;
UPDATE product SET productName = 'موديلات 330 سيفن ار', productDescription = '', productCatId = '71', productBuyPrice = '330.00', productSellAllPrice = '330.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02270',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '330',lastbuyprice_withDiscount = '303.6',meanbuyprice = '330',meanbuyprice_withDiscount = '303.6' , productbuypricereal = '330.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='330',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='330',meanbuyprice_withTax='330',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='303.6',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2270';
UPDATE buybilldetail SET  lastbuyprice = 330 , meanbuyprice = 330, lastbuyprice_withDiscount = 303.6, meanbuyprice_withDiscount = 303.6
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 303.6
                where buybilldetailid = 1500;
UPDATE productunit SET proUnitBuyPrice  = 330 * productnumber WHERE productid = 2270;
UPDATE storedetail SET  productquantity = '124', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3663';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2270', '1', '64', '0', '268', 'اضافة فاتورة مشتريات', 'buyBillController.php', '60', '124', '1', '2026-10-20 16:45:22','0','0'); -- id=15362
UPDATE supplier SET  suppliercurrentDebt = '169127',suppliercurrentDebtInCurrency= '169127' , userid = '1', supplierdate = '2026-10-20 16:54:03'   WHERE supplierid = '25';
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', '8495.00', '160632', '0', 'اضافة فاتورة مشتريات', '268', '169127', '2026-10-20 16:45:22', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','160632','1','8495','160632','169127','0',''); -- id=757
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '160632', '160632', '2026-10-20', '1', '0', '0', '2026-10-20 16:54:03','اضافة فاتورة مشتريات رقم 268','1','0',null,'0','268','buyBillController.php?do=details&id=268'); -- id=3999
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('3999', '382', '160632', '','0'); -- id=4105
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24007284.29', 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 ('3999', '444', '160632', '','0'); -- id=4001
UPDATE accountstree SET name = 'سيفن ار - مورد', customName = 'سيفن ار - مورد', customNameEn = 'سيفن ار - مورد', nameEn = 'سيفن ار - مورد', parent = '81', accountNature = '1', theValue = '-506948', 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';
update buybill set dailyentryid='3999,0' where buybillid=268;
COMMIT;
UPDATE product SET overAllAveragePrice = 276 WHERE productId = 2269;UPDATE product SET overAllAveragePrice = 303.6 WHERE productId = 2270;UPDATE product SET overAllAveragePrice = 312.8 WHERE productId = 2271;UPDATE product SET overAllAveragePrice = 322 WHERE productId = 2272;UPDATE product SET overAllAveragePrice = 331.2 WHERE productId = 2273;UPDATE product SET overAllAveragePrice = 294.4 WHERE productId = 2274;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:24:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:54:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:54:03', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=268'); -- id=15708
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:24:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:54:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:54:13', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=268&type=2'); -- id=15709
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:25:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:55:06", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:55:06', '5', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15710
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 ('06ad77253a2b15', '2026-10-20 16:53:23', '40', '394740.00', '472490', '0', '0', '77750.00',  '77750.00', '0', '77750', '1', '2026-10-20 16:55:06', '', '5', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=269
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 ('01517', '269', '32', '1517', '50', '380', '19000.00', '0', '', '2026-10-20 16:55:06', '1517','','','0','0','0','0','0',null,'380','19000','0','0','0','0','0','0','0','0','1'); -- id=1501
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:53:23', 1, 1517, 0, 0
                    , 380, 50, 0, 0, 5, '2026-10-20 16:55:06')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 16:55:06' ; -- id=6761
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1517', '380', '50', '0', 'buyBillController.php', '1501', '', '0', '0'); -- id=1104
UPDATE product SET  productBuyPrice = "380" WHERE productId = 1517 ;
UPDATE buybilldetail SET  quantitybefore = 25 WHERE buybilldetailid = 1501 ;
UPDATE product SET productName = 'موديل 395 كوين', productDescription = '', productCatId = '32', productBuyPrice = '380.00', productSellAllPrice = '395.00', productSellUnitPrice = '395.00', productSellHalfPrice = '395.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01517',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 = '3.95' , buyhalf_precentage = '3.95' , 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 = '1517';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 1501;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 1517;
UPDATE storedetail SET  productquantity = '75', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '1542';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1517', '1', '50', '0', '269', 'اضافة فاتورة مشتريات', 'buyBillController.php', '25', '75', '5', '2026-10-20 16:53:23','0','0'); -- id=15363
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 ('02277', '269', '32', '2277', '100', '395', '39500.00', '0', '', '2026-10-20 16:55:06', '2277','','','0','0','0','0','0',null,'395','39500','0','0','0','0','0','0','0','0','1'); -- id=1502
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:53:23', 1, 2277, 0, 0
                    , 395, 100, 0, 0, 5, '2026-10-20 16:55:06')
                ON DUPLICATE KEY UPDATE buyprice = 395,
                        buyQuantity =buyQuantity+100, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 16:55:06' ; -- id=6762
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2277', '395', '100', '0', 'buyBillController.php', '1502', '', '0', '0'); -- id=1105
UPDATE product SET  productBuyPrice = "395" WHERE productId = 2277 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1502 ;
UPDATE product SET productName = 'موديل 410 كوين ', productDescription = '', productCatId = '32', productBuyPrice = '395.00', productSellAllPrice = '410.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02277',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '395',meanbuyprice = '395',meanbuyprice_withDiscount = '395' , productbuypricereal = '395.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.80' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',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='395',meanbuyprice_withTax='395',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2277';
UPDATE buybilldetail SET  lastbuyprice = 395 , meanbuyprice = 395, lastbuyprice_withDiscount = 395, meanbuyprice_withDiscount = 395
        , lastbuyprice_withTax = 395, meanbuyprice_withTax = 395, lastbuyprice_withDiscountAndTax = 395
                where buybilldetailid = 1502;
UPDATE productunit SET proUnitBuyPrice  = 395 * productnumber WHERE productid = 2277;
UPDATE storedetail SET  productquantity = '100', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3670';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2277', '1', '100', '0', '269', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '100', '5', '2026-10-20 16:53:23','0','0'); -- id=15364
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 ('02278', '269', '32', '2278', '50', '385', '19250.00', '0', '', '2026-10-20 16:55:06', '2278','','','0','0','0','0','0',null,'385','19250','0','0','0','0','0','0','0','0','1'); -- id=1503
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 16:53:23', 1, 2278, 0, 0
                    , 385, 50, 0, 0, 5, '2026-10-20 16:55:06')
                ON DUPLICATE KEY UPDATE buyprice = 385,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 5,sysDate = '2026-10-20 16:55:06' ; -- id=6763
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2278', '385', '50', '0', 'buyBillController.php', '1503', '', '0', '0'); -- id=1106
UPDATE product SET  productBuyPrice = "385" WHERE productId = 2278 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1503 ;
UPDATE product SET productName = 'موديل 400 كوين ', productDescription = '', productCatId = '32', productBuyPrice = '385.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '5', limitamount = '0', parcode = '02278',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '385',lastbuyprice_withDiscount = '385',meanbuyprice = '385',meanbuyprice_withDiscount = '385' , productbuypricereal = '385.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.90' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='385',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='385',meanbuyprice_withTax='385',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='385',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2278';
UPDATE buybilldetail SET  lastbuyprice = 385 , meanbuyprice = 385, lastbuyprice_withDiscount = 385, meanbuyprice_withDiscount = 385
        , lastbuyprice_withTax = 385, meanbuyprice_withTax = 385, lastbuyprice_withDiscountAndTax = 385
                where buybilldetailid = 1503;
UPDATE productunit SET proUnitBuyPrice  = 385 * productnumber WHERE productid = 2278;
UPDATE storedetail SET  productquantity = '50', userid = '5', storedetaildate = '2026-10-20' WHERE storedetailid = '3671';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2278', '1', '50', '0', '269', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '50', '5', '2026-10-20 16:53:23','0','0'); -- id=15365
UPDATE supplier SET  suppliercurrentDebt = '472490',suppliercurrentDebtInCurrency= '472490' , userid = '5', supplierdate = '2026-10-20 16:55:06'   WHERE supplierid = '40';
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 ('40', '394740.00', '77750', '0', 'اضافة فاتورة مشتريات', '269', '472490', '2026-10-20 16:53:23', '5', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','77750','1','394740','77750','472490','0',''); -- id=758
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '77750', '77750', '2026-10-20', '5', '0', '0', '2026-10-20 16:55:06','اضافة فاتورة مشتريات رقم 269','1','0',null,'0','269','buyBillController.php?do=details&id=269'); -- id=4000
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4000', '382', '77750', '','0'); -- id=4106
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24085034.29', 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 ('4000', '459', '77750', '','0'); -- id=4002
UPDATE accountstree SET name = 'كوين - مورد', customName = 'كوين - مورد', customNameEn = 'كوين - مورد', nameEn = 'كوين - مورد', parent = '81', accountNature = '1', theValue = '100750', 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 = '459';
update buybill set dailyentryid='4000,0' where buybillid=269;
COMMIT;
UPDATE product SET overAllAveragePrice = 380 WHERE productId = 1517;UPDATE product SET overAllAveragePrice = 395 WHERE productId = 2277;UPDATE product SET overAllAveragePrice = 385 WHERE productId = 2278;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:25:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:55:06", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 16:55:06', '5', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=269'); -- id=15711
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:25:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:55:09", deviceType = "DESKTOP" WHERE userid = 5;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:55:09', '5', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=269&type=2'); -- id=15712
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:25:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:55:39", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:55:39', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15713
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:25:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:55:39", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 16:55:39', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15714
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:27:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 16:57:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 16:57:12', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15715
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:36:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:06:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 17:06:24', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15716
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-20 13:36:24";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 17:06:24", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 17:06:24', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15717
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:36:27";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:06:27", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 17:06:27', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15718
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:36:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:06:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 17:06:32', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15719

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad770942543b
-- ----------------------------------------------------------------------------------------------------

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-20 17:06:32', '06ad770942543b', '1', '0.00', '0', '0', '1', '4410.00', '4410', '4410', '0', '1', '2026-10-20 17:06:32', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '9' ,'0','','','','','-1','0','0','0','0','0','4410','0','','0','0','4410','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1128
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','اضافة فاتورة مبيعات','1128', '0', '2026-10-20 17:06:32', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '4410', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 17:06:32','0','0','',''); -- id=1347
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6016;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450.8','02026', '1128', '166', '2026', '9', '490', '4410', '0', '', '0', '2026-10-20 17:06:32', '2026', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6016-9,','1','1','0','0','490','4410','0','','0','0.00','0','0','0','0'); -- id=4493
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 450.80, meanbuyprice_withDiscount = 450.80
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 490, lastbuyprice_withDiscountAndTax = 450.8
                where sellbilldetailid = 4493;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2026, '2026-10-20', 4410, 4410, 4410
                    , 4410, 4057.2, 4057.2, 4057.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4410, 4410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4410, sellCostBuyPrice =sellCostBuyPrice+4410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4057.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4057.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4057.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4410, 4410, 4410
                    , 4410, 4057.2, 4057.2, 4057.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4410, 4410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4410, sellCostBuyPrice =sellCostBuyPrice+4410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4057.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4057.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4057.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '12', userid = '2', storedetaildate = '2026-10-20 17:06:32' WHERE storedetailid = '3385';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2026', '1', '9', '1', '1128', 'اضافة فاتورة مبيعات', 'sellbillController.php', '21', '12', '2', '2026-10-20 17:06:32','0','0'); -- id=15366
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7027098.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('7022688.5','4410', '0', '2', 'اضافة فاتورة مبيعات', '1128', '7027098.5', '2026-10-20 17:06:32', '2',  'sellbillController.php','1','','0'); -- id=1391
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4410', '4410', '2026-10-20', '2', '0', '0', '2026-10-20 17:06:32','اضافة فاتورة مبيعات رقم 1128','1','0',null,'0','1128','sellbillController.php?do=showDetail&sellbillid=1128'); -- id=4001
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4001', '419', '4410', '','0'); -- id=4107
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7027098', 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 ('4001', '143', '4410', '','0'); -- id=4003
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12725365', 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 ( '4057.2', '4057.2', '2026-10-20', '2', '0', '0', '2026-10-20 17:06:32','اضافة فاتورة مبيعات رقم 1128 - صرف البضاعة من المخزن','1','0',null,'0','1128','sellbillController.php?do=showDetail&sellbillid=1128'); -- id=4002
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4002', '402', '4057.2', '','0'); -- id=4108
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11774121.61', 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 ('4002', '382', '4057.2', '','0'); -- id=4004
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24080977.09', 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='4001,0,4002' where sellbillid=1128;
 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-20', 4410, 4410, 4410
                    , 4410, 4057.2, 4057.2, 4057.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4410, 4410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4410, sellCostBuyPrice =sellCostBuyPrice+4410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4057.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4057.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4057.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4410, 4410, 4410
                    , 4410, 4057.2, 4057.2, 4057.2
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,4410, 4410, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4410, sellCostBuyPrice =sellCostBuyPrice+4410
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4410, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4410
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4057.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4057.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4057.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4410
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4410
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 4410, 4410, 4410
                    , 4410, 4057.2, 4057.2, 4057.2, 4410, 4410)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4410, netSellCostBuyPrice = netSellCostBuyPrice+4410
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+4410
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+4410
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+4057.2
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+4057.2
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+4057.2
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+4410
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+4410;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad770942543b and sellbillId = 1128 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:36:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:06:32", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 17:06:32', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15720
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-20 13:37:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:07:49", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 17:07:49', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15721
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-20 13:37:49";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 17:07:49', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15722
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:38:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:08:28", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:08:28', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15723
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:38:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:08:34", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 17:08:34', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15724
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:38:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:08:36", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 17:08:36', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15725
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:40:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:10:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 17:10:04', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15726
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:41:15";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:11:15", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:11:15', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15727
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:41:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:11:19", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:11:19', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15728
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:41:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:11:22", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:11:22', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15729
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:41:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:11:28", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:11:28', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15730
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:41:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:11:57", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:11:57', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15731
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:42:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:12:22", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:12:22', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15732
UPDATE product SET productName = 'اوفر سايز دوبل قصات الالماني', productDescription = '', productCatId = '147', productBuyPrice = '429.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01884',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '429.00',lastbuyprice_withDiscount = '429',meanbuyprice = '429.00',meanbuyprice_withDiscount = '429' , productbuypricereal = '429.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.23' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='429',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='429',meanbuyprice_withTax='429',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='429',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1884';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1884, 1,'2026-10-20 17:13:54',7)
                ON DUPLICATE KEY UPDATE productid = 1884, edited = 1, sysdate = '2026-10-20 17:13:54', userid = 7; -- id=2813
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:43:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:13:55", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 17:13:55', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15733
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-20 13:43:55";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 17:13:55', '7', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15734
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:43:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:13:58", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 17:13:58', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15735
UPDATE product SET productName = 'اوفر سايز دوبل قصات الالماني', productDescription = '', productCatId = '147', productBuyPrice = '429.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01884',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '429.00',lastbuyprice_withDiscount = '429',meanbuyprice = '429.00',meanbuyprice_withDiscount = '429' , productbuypricereal = '429.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.23' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='429',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='429',meanbuyprice_withTax='429',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='429',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1884';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1884, 1,'2026-10-20 17:14:17',7)
                ON DUPLICATE KEY UPDATE productid = 1884, edited = 1, sysdate = '2026-10-20 17:14:17', userid = 7; -- id=2813
UPDATE product SET productName = 'بوكس فيت بيزك الالماني', productDescription = '', productCatId = '147', productBuyPrice = '289.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01886',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '289.00',lastbuyprice_withDiscount = '289',meanbuyprice = '289.00',meanbuyprice_withDiscount = '289' , productbuypricereal = '289.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.73' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='289',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='289',meanbuyprice_withTax='289',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='289',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1886';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1886, 1,'2026-10-20 17:14:19',7)
                ON DUPLICATE KEY UPDATE productid = 1886, edited = 1, sysdate = '2026-10-20 17:14:19', userid = 7; -- id=2815
UPDATE product SET productName = 'بوكس فيت بيزك الالماني', productDescription = '', productCatId = '147', productBuyPrice = '289.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01886',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '289.00',lastbuyprice_withDiscount = '289',meanbuyprice = '289.00',meanbuyprice_withDiscount = '289' , productbuypricereal = '289.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.73' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='289',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='289',meanbuyprice_withTax='289',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='289',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1886';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1886, 1,'2026-10-20 17:14:41',7)
                ON DUPLICATE KEY UPDATE productid = 1886, edited = 1, sysdate = '2026-10-20 17:14:41', userid = 7; -- id=2815
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:46:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:16:02", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:16:02', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15736
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:47:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:17:00", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 17:17:00', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15737
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 ('06ad777260e245', '2026-10-20 17:13:58', '161', '506877.00', '594663', '0', '0', '87786.00',  '87786.00', '0', '87786', '1', '2026-10-20 17:17:00', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=270
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 ('01884', '270', '147', '1884', '144', '429', '61776.00', '0', '', '2026-10-20 17:17:00', '1884','','','0','0','0','0','0',null,'429','61776','0','0','0','0','0','0','0','0','1'); -- id=1504
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 17:13:58', 1, 1884, 0, 0
                    , 429, 144, 0, 0, 7, '2026-10-20 17:17:00')
                ON DUPLICATE KEY UPDATE buyprice = 429,
                        buyQuantity =buyQuantity+144, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-20 17:17:00' ; -- id=6764
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1884', '429', '144', '0', 'buyBillController.php', '1504', '', '0', '0'); -- id=1107
UPDATE product SET  productBuyPrice = "429" WHERE productId = 1884 ;
UPDATE buybilldetail SET  quantitybefore = 162 WHERE buybilldetailid = 1504 ;
UPDATE product SET productName = 'اوفر سايز دوبل قصات الالماني', productDescription = '', productCatId = '147', productBuyPrice = '429.00', productSellAllPrice = '460.00', productSellUnitPrice = '460.00', productSellHalfPrice = '460.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01884',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '429',lastbuyprice_withDiscount = '429',meanbuyprice = '429',meanbuyprice_withDiscount = '429' , productbuypricereal = '429.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.23' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='429',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='429',meanbuyprice_withTax='429',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='429',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1884';
UPDATE buybilldetail SET  lastbuyprice = 429 , meanbuyprice = 429, lastbuyprice_withDiscount = 429, meanbuyprice_withDiscount = 429
        , lastbuyprice_withTax = 429, meanbuyprice_withTax = 429, lastbuyprice_withDiscountAndTax = 429
                where buybilldetailid = 1504;
UPDATE productunit SET proUnitBuyPrice  = 429 * productnumber WHERE productid = 1884;
UPDATE storedetail SET  productquantity = '306', userid = '7', storedetaildate = '2026-10-20' WHERE storedetailid = '2901';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1884', '1', '144', '0', '270', 'اضافة فاتورة مشتريات', 'buyBillController.php', '162', '306', '7', '2026-10-20 17:13:58','0','0'); -- id=15367
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 ('01886', '270', '147', '1886', '90', '289', '26010.00', '0', '', '2026-10-20 17:17:00', '1886','','','0','0','0','0','0',null,'289','26010','0','0','0','0','0','0','0','0','1'); -- id=1505
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 17:13:58', 1, 1886, 0, 0
                    , 289, 90, 0, 0, 7, '2026-10-20 17:17:00')
                ON DUPLICATE KEY UPDATE buyprice = 289,
                        buyQuantity =buyQuantity+90, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-20 17:17:00' ; -- id=6765
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1886', '289', '90', '0', 'buyBillController.php', '1505', '', '0', '0'); -- id=1108
UPDATE product SET  productBuyPrice = "289" WHERE productId = 1886 ;
UPDATE buybilldetail SET  quantitybefore = 28 WHERE buybilldetailid = 1505 ;
UPDATE product SET productName = 'بوكس فيت بيزك الالماني', productDescription = '', productCatId = '147', productBuyPrice = '289.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01886',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '289',lastbuyprice_withDiscount = '289',meanbuyprice = '289',meanbuyprice_withDiscount = '289' , productbuypricereal = '289.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.73' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='289',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='289',meanbuyprice_withTax='289',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='289',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1886';
UPDATE buybilldetail SET  lastbuyprice = 289 , meanbuyprice = 289, lastbuyprice_withDiscount = 289, meanbuyprice_withDiscount = 289
        , lastbuyprice_withTax = 289, meanbuyprice_withTax = 289, lastbuyprice_withDiscountAndTax = 289
                where buybilldetailid = 1505;
UPDATE productunit SET proUnitBuyPrice  = 289 * productnumber WHERE productid = 1886;
UPDATE storedetail SET  productquantity = '118', userid = '7', storedetaildate = '2026-10-20' WHERE storedetailid = '2903';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1886', '1', '90', '0', '270', 'اضافة فاتورة مشتريات', 'buyBillController.php', '28', '118', '7', '2026-10-20 17:13:58','0','0'); -- id=15368
UPDATE supplier SET  suppliercurrentDebt = '594663',suppliercurrentDebtInCurrency= '594663' , userid = '7', supplierdate = '2026-10-20 17:17:00'   WHERE supplierid = '161';
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 ('161', '506877.00', '87786', '0', 'اضافة فاتورة مشتريات', '270', '594663', '2026-10-20 17:13:58', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','87786','1','506877','87786','594663','0',''); -- id=759
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '87786', '87786', '2026-10-20', '7', '0', '0', '2026-10-20 17:17:00','اضافة فاتورة مشتريات رقم 270','1','0',null,'0','270','buyBillController.php?do=details&id=270'); -- id=4003
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4003', '382', '87786', '','0'); -- id=4109
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24168763.09', 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 ('4003', '644', '87786', '','0'); -- id=4005
UPDATE accountstree SET name = 'الالماني', customName = 'الالماني', customNameEn = 'الالماني', nameEn = 'الالماني', parent = '81', accountNature = '1', theValue = '594663', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 18:57:07' WHERE id = '644';
update buybill set dailyentryid='4003,0' where buybillid=270;
COMMIT;
UPDATE product SET overAllAveragePrice = 429 WHERE productId = 1884;UPDATE product SET overAllAveragePrice = 289 WHERE productId = 1886;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:47:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:17:00", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 17:17:00', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=270'); -- id=15738
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:47:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:17:05", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:17:05', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=270&type=2'); -- id=15739
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:49:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:19:30", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:19:30', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15740
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:49:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:19:40", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:19:40', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15741
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:49:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:19:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:19:48', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15742
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:49:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:19:50", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 17:19:50', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=15743
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:50:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:20:04", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:20:04', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15744
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:50:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:20:26", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:20:26', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15745
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:54:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:24:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 17:24:12', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15746
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:54:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:24:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 17:24:16', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15747
UPDATE product SET productName = 'توجي مقطع 4 لون', productDescription = '', productCatId = '38', productBuyPrice = '405.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07923',type ='0', expireDate = '0' , dailyentryId = '460',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7923',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='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='1',lastbuyprice_withDiscountAndTax='405',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 = '1105';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1105, 1,'2026-10-20 17:24:43',7)
                ON DUPLICATE KEY UPDATE productid = 1105, edited = 1, sysdate = '2026-10-20 17:24:43', userid = 7; -- id=1750
UPDATE product SET productName = 'بوكس فيت بيزك الالماني', productDescription = '', productCatId = '147', productBuyPrice = '289.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01886',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '289.00',lastbuyprice_withDiscount = '289',meanbuyprice = '289.00',meanbuyprice_withDiscount = '289' , productbuypricereal = '289.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.73' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='289',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='289',meanbuyprice_withTax='289',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='289',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1886';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1886, 1,'2026-10-20 17:24:45',7)
                ON DUPLICATE KEY UPDATE productid = 1886, edited = 1, sysdate = '2026-10-20 17:24:45', userid = 7; -- id=2815
UPDATE product SET productName = 'توجي مقطع 4 لون', productDescription = '', productCatId = '38', productBuyPrice = '405.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07923',type ='0', expireDate = '0' , dailyentryId = '460',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7923',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='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='1',lastbuyprice_withDiscountAndTax='405',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 = '1105';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1105, 1,'2026-10-20 17:24:45',7)
                ON DUPLICATE KEY UPDATE productid = 1105, edited = 1, sysdate = '2026-10-20 17:24:45', userid = 7; -- id=1750
UPDATE product SET productName = 'بوكس فيت بيزك الالماني', productDescription = '', productCatId = '147', productBuyPrice = '289.00', productSellAllPrice = '320.00', productSellUnitPrice = '320.00', productSellHalfPrice = '320.00', productDate = '2026-10-12', conditions = '0', userId = '1', limitamount = '0', parcode = '01886',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '289.00',lastbuyprice_withDiscount = '289',meanbuyprice = '289.00',meanbuyprice_withDiscount = '289' , productbuypricereal = '289.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '10.73' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='289',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='289',meanbuyprice_withTax='289',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='289',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1886';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1886, 1,'2026-10-20 17:24:50',7)
                ON DUPLICATE KEY UPDATE productid = 1886, edited = 1, sysdate = '2026-10-20 17:24:50', userid = 7; -- id=2815
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:54:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:24:50", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:24:50', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15748
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:54:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:24:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 17:24:58', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15749
UPDATE product SET productName = 'توجي مقطع 4 لون', productDescription = '', productCatId = '38', productBuyPrice = '405.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07923',type ='0', expireDate = '0' , dailyentryId = '460',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7923',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='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='1',lastbuyprice_withDiscountAndTax='405',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 = '1105';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1105, 1,'2026-10-20 17:25:05',7)
                ON DUPLICATE KEY UPDATE productid = 1105, edited = 1, sysdate = '2026-10-20 17:25:05', userid = 7; -- id=1750
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:55:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:25:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 17:25:07', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15750
UPDATE product SET productName = 'توجي مقطع 4 لون', productDescription = '', productCatId = '38', productBuyPrice = '405.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07923',type ='0', expireDate = '0' , dailyentryId = '460',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7923',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='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='1',lastbuyprice_withDiscountAndTax='405',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 = '1105';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1105, 1,'2026-10-20 17:25:40',7)
                ON DUPLICATE KEY UPDATE productid = 1105, edited = 1, sysdate = '2026-10-20 17:25:40', userid = 7; -- id=1750
UPDATE product SET productName = 'توجي مقطع 4 لون', productDescription = '', productCatId = '38', productBuyPrice = '405.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07923',type ='0', expireDate = '0' , dailyentryId = '460',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7923',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='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='1',lastbuyprice_withDiscountAndTax='405',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 = '1105';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1105, 1,'2026-10-20 17:25:52',7)
                ON DUPLICATE KEY UPDATE productid = 1105, edited = 1, sysdate = '2026-10-20 17:25:52', userid = 7; -- id=1750
UPDATE product SET productName = 'توجي مقطع 4 لون', productDescription = '', productCatId = '38', productBuyPrice = '405.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07923',type ='0', expireDate = '0' , dailyentryId = '460',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7923',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='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='1',lastbuyprice_withDiscountAndTax='405',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 = '1105';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1105, 1,'2026-10-20 17:26:09',7)
                ON DUPLICATE KEY UPDATE productid = 1105, edited = 1, sysdate = '2026-10-20 17:26:09', userid = 7; -- id=1750
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:56:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:26:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 17:26:40', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15751
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:56:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:26:46", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:26:46', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15752
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('توجي استرس 4لون هافي','','38','455','470','0','0','2026-10-20','0','7','0','','0','0','0','0','0','455','455','455','455','455','0','3.3','0','0','.','0','0','0','455','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','455','455','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','455','0','0','0','0','0','0','','','0','0','0','0'); -- id=2279
UPDATE product SET productName = 'توجي استرس 4لون هافي', productDescription = '', productCatId = '38', productBuyPrice = '455', productSellAllPrice = '470', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '7', limitamount = '0', parcode = '02279',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '455',meanbuyprice = '455',meanbuyprice_withDiscount = '455' , productbuypricereal = '455' , buypricereal_precentage = '0' , buytotal_precentage = '3.3' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2279';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2279', '1', '2026-10-20', '7', '0','0227901','470','0','0','455','','0','0','0','0','0','0','0','0','0','0'); -- id=2279
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2279', '1', '0', '7', '2026-10-20'); -- id=3672
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2279', '1', '0', '0', '2279', 'إضافة منتج', 'productController.php', '0', '0', '7', '2026-10-20','0','0'); -- id=15369
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2279, 1,'2026-10-20 17:26:46',7)
                ON DUPLICATE KEY UPDATE productid = 2279, edited = 1, sysdate = '2026-10-20 17:26:46', userid = 7; -- id=3351
UPDATE product SET productName = 'توجي استرس 4لون هافي', productDescription = '', productCatId = '38', productBuyPrice = '455.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '7', limitamount = '0', parcode = '02279',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '455',meanbuyprice = '455',meanbuyprice_withDiscount = '455' , productbuypricereal = '455' , buypricereal_precentage = '0' , buytotal_precentage = '3.3' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2279';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:56:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:26:48", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:26:48', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15753
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:56:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:26:50", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 17:26:50', '7', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15754
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:57:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:27:12", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:27:12', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15755
UPDATE product SET productName = 'توجي مقطع 4 لون', productDescription = '', productCatId = '38', productBuyPrice = '405.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07923',type ='0', expireDate = '0' , dailyentryId = '460',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7923',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='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='1',lastbuyprice_withDiscountAndTax='405',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 = '1105';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1105, 1,'2026-10-20 17:27:16',7)
                ON DUPLICATE KEY UPDATE productid = 1105, edited = 1, sysdate = '2026-10-20 17:27:16', userid = 7; -- id=1750
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:57:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:27:39", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:27:39', '7', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=show'); -- id=15756
UPDATE product SET productName = 'توجي استرس 4لون هافي', productDescription = '', productCatId = '38', productBuyPrice = '455.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '7', limitamount = '0', parcode = '02279',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455.00',lastbuyprice_withDiscount = '455',meanbuyprice = '455.00',meanbuyprice_withDiscount = '455' , productbuypricereal = '455.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2279';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2279, 1,'2026-10-20 17:27:48',7)
                ON DUPLICATE KEY UPDATE productid = 2279, edited = 1, sysdate = '2026-10-20 17:27:48', userid = 7; -- id=3351
UPDATE product SET productName = 'توجي استرس 4لون هافي', productDescription = '', productCatId = '38', productBuyPrice = '455.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '7', limitamount = '0', parcode = '02279',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455.00',lastbuyprice_withDiscount = '455',meanbuyprice = '455.00',meanbuyprice_withDiscount = '455' , productbuypricereal = '455.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2279';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2279, 1,'2026-10-20 17:27:58',7)
                ON DUPLICATE KEY UPDATE productid = 2279, edited = 1, sysdate = '2026-10-20 17:27:58', userid = 7; -- id=3351
UPDATE product SET productName = 'توجي مقطع 4 لون', productDescription = '', productCatId = '38', productBuyPrice = '405.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07923',type ='0', expireDate = '0' , dailyentryId = '460',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7923',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='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='1',lastbuyprice_withDiscountAndTax='405',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 = '1105';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1105, 1,'2026-10-20 17:28:00',7)
                ON DUPLICATE KEY UPDATE productid = 1105, edited = 1, sysdate = '2026-10-20 17:28:00', userid = 7; -- id=1750
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:58:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:28:25", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 17:28:25', '7', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15757
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 ('06ad77a2a59b4b', '2026-10-20 17:26:50', '10', '52455.00', '86855', '0', '0', '34400.00',  '34400.00', '0', '34400', '1', '2026-10-20 17:28:25', '', '7', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=271
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 ('02279', '271', '38', '2279', '40', '455', '18200.00', '0', '', '2026-10-20 17:28:25', '2279','','','0','0','0','0','0',null,'455','18200','0','0','0','0','0','0','0','0','1'); -- id=1506
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 17:26:50', 1, 2279, 0, 0
                    , 455, 40, 0, 0, 7, '2026-10-20 17:28:25')
                ON DUPLICATE KEY UPDATE buyprice = 455,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-20 17:28:25' ; -- id=6766
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2279', '455', '40', '0', 'buyBillController.php', '1506', '', '0', '0'); -- id=1109
UPDATE product SET  productBuyPrice = "455" WHERE productId = 2279 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1506 ;
UPDATE product SET productName = 'توجي استرس 4لون هافي', productDescription = '', productCatId = '38', productBuyPrice = '455.00', productSellAllPrice = '470.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '7', limitamount = '0', parcode = '02279',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '455',lastbuyprice_withDiscount = '455',meanbuyprice = '455',meanbuyprice_withDiscount = '455' , productbuypricereal = '455.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.30' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='455',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='455',meanbuyprice_withTax='455',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='455',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2279';
UPDATE buybilldetail SET  lastbuyprice = 455 , meanbuyprice = 455, lastbuyprice_withDiscount = 455, meanbuyprice_withDiscount = 455
        , lastbuyprice_withTax = 455, meanbuyprice_withTax = 455, lastbuyprice_withDiscountAndTax = 455
                where buybilldetailid = 1506;
UPDATE productunit SET proUnitBuyPrice  = 455 * productnumber WHERE productid = 2279;
UPDATE storedetail SET  productquantity = '40', userid = '7', storedetaildate = '2026-10-20' WHERE storedetailid = '3672';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2279', '1', '40', '0', '271', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '7', '2026-10-20 17:26:50','0','0'); -- id=15370
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 ('07923', '271', '38', '1105', '40', '405', '16200.00', '0', '', '2026-10-20 17:28:25', '1105','','','0','0','0','0','0',null,'405','16200','0','0','0','0','0','0','0','0','1'); -- id=1507
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 17:26:50', 1, 1105, 0, 0
                    , 405, 40, 0, 0, 7, '2026-10-20 17:28:25')
                ON DUPLICATE KEY UPDATE buyprice = 405,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 7,sysDate = '2026-10-20 17:28:25' ; -- id=6767
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('1105', '405', '40', '0', 'buyBillController.php', '1507', '', '0', '0'); -- id=1110
UPDATE product SET  productBuyPrice = "405" WHERE productId = 1105 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1507 ;
UPDATE product SET productName = 'توجي مقطع 4 لون', productDescription = '', productCatId = '38', productBuyPrice = '405.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07923',type ='0', expireDate = '0' , dailyentryId = '460',isService = '0',isOptic = '0',lastbuyprice = '405',lastbuyprice_withDiscount = '405',meanbuyprice = '405',meanbuyprice_withDiscount = '405' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='400',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7923',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='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='1',lastbuyprice_withDiscountAndTax='405',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 = '1105';
UPDATE buybilldetail SET  lastbuyprice = 405 , meanbuyprice = 405, lastbuyprice_withDiscount = 405, meanbuyprice_withDiscount = 405
        , lastbuyprice_withTax = 405, meanbuyprice_withTax = 405, lastbuyprice_withDiscountAndTax = 405
                where buybilldetailid = 1507;
UPDATE productunit SET proUnitBuyPrice  = 405 * productnumber WHERE productid = 1105;
UPDATE storedetail SET  productquantity = '40', userid = '7', storedetaildate = '2026-10-20' WHERE storedetailid = '1105';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1105', '1', '40', '0', '271', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '7', '2026-10-20 17:26:50','0','0'); -- id=15371
UPDATE supplier SET  suppliercurrentDebt = '86855',suppliercurrentDebtInCurrency= '86855' , userid = '7', supplierdate = '2026-10-20 17:28:25'   WHERE supplierid = '10';
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 ('10', '52455.00', '34400', '0', 'اضافة فاتورة مشتريات', '271', '86855', '2026-10-20 17:26:50', '7', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','34400','1','52455','34400','86855','0',''); -- id=760
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '34400', '34400', '2026-10-20', '7', '0', '0', '2026-10-20 17:28:25','اضافة فاتورة مشتريات رقم 271','1','0',null,'0','271','buyBillController.php?do=details&id=271'); -- id=4004
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4004', '382', '34400', '','0'); -- id=4110
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24203163.09', 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 ('4004', '429', '34400', '','0'); -- id=4006
UPDATE accountstree SET name = 'هرفي - مورد', customName = 'هرفي - مورد', customNameEn = 'هرفي - مورد', nameEn = 'هرفي - مورد', parent = '81', accountNature = '1', theValue = '-140380', 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 = '429';
update buybill set dailyentryid='4004,0' where buybillid=271;
COMMIT;
UPDATE product SET overAllAveragePrice = 405 WHERE productId = 1105;UPDATE product SET overAllAveragePrice = 455 WHERE productId = 2279;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:58:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:28:25", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 17:28:25', '7', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=271'); -- id=15758
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:58:29";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:28:29", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:28:29', '7', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=271&type=2'); -- id=15759
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:58:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:28:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 17:28:40', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15760
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:58:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:28:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 17:28:49', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15761
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:59:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:29:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 17:29:48', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15762
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:59:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:29:49", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:29:49', '7', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15763
UPDATE product SET productName = 'توجي مقطع 4 لون', productDescription = '', productCatId = '38', productBuyPrice = '405.00', productSellAllPrice = '420.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-09-27', conditions = '0', userId = '1', limitamount = '0', parcode = '07923',type ='0', expireDate = '0' , dailyentryId = '460',isService = '0',isOptic = '0',lastbuyprice = '405.00',lastbuyprice_withDiscount = '405',meanbuyprice = '405.00',meanbuyprice_withDiscount = '405' , productbuypricereal = '400.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '0.00' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='405',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',webApiId='7923',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='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='1',lastbuyprice_withDiscountAndTax='405',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 = '1105';
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (1105, 1,'2026-10-20 17:29:49',7)
                ON DUPLICATE KEY UPDATE productid = 1105, edited = 1, sysdate = '2026-10-20 17:29:49', userid = 7; -- id=1750
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 13:59:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:29:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 17:29:55', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15764
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:00:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:30:00", deviceType = "DESKTOP" WHERE userid = 7;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 17:30:00', '7', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15765
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:06:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:36:52", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 17:36:53', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15766
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:06:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:36:53", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 17:36:53', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15767
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:07:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:37:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 17:37:07', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15768
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:07:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:37:20", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 17:37:20', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1086'); -- id=15769
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:08:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:38:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 17:38:07', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15770
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:08:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:38:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 17:38:07', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15771
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:08:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:38:16", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 17:38:16', '3', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php?do=show'); -- id=15772
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:23:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:53:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 17:53:35', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15773
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:23:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:53:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 17:53:49', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15774
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:24:28";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:54:28", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-20 17:54:28', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=show'); -- id=15775
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:24:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:54:49", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 17:54:49', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15776
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:25:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:55:51", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 17:55:51', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15777
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:25:51";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:55:51", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 17:55:51', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15778
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:26:14";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 17:56:14", deviceType = "DESKTOP" WHERE userid = 6;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 17:56:14', '6', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15779
UPDATE user SET loginip = "" WHERE userid = 1;
UPDATE user SET loginip = "" WHERE userid = 7;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:31:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:01:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:01:01', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15780
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:31:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:01:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:01:06', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15781
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:31:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:01:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnBuyBillController.php', '2026-10-20 18:01:08', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnBuyBillController.php?do=details&id=18'); -- id=15782
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:31:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:01:52", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:01:52', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15783
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:31:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:01:52", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:01:52', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15784
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:32:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:02:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:02:07', '3', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15785

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad780f7400a9
-- ----------------------------------------------------------------------------------------------------

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-20 18:02:07', '06ad780f7400a9', '1', '0.00', '0', '0', '1', '2725.00', '2725', '2725', '0', '1', '2026-10-20 18:02:07', '', '3', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '7' ,'0','','','','','-1','0','0','0','0','0','2725','0','','0','0','2725','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1129
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','اضافة فاتورة مبيعات','1129', '0', '2026-10-20 18:02:07', '3', 'sellbillController.php', 'اضافة فاتورة مبيعات', '2725', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 18:02:07','0','0','',''); -- id=1348
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+2 where id = 76;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('441','01384', '1129', '95', '1384', '2', '490', '980', '0', '', '0', '2026-10-20 18:02:07', '1384', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','76-2,','1','1','0','0','490','980','0','','0','0.00','0','0','0','0'); -- id=4494
UPDATE sellbilldetail SET  lastbuyprice = 490.00 , meanbuyprice = 490.00, lastbuyprice_withDiscount = 441.00, meanbuyprice_withDiscount = 459.20
        , lastbuyprice_withTax = 490, meanbuyprice_withTax = 308.12, lastbuyprice_withDiscountAndTax = 441
                where sellbilldetailid = 4494;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1384, '2026-10-20', 980, 980, 980
                    , 980, 882, 918.4, 882
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2, 0, 980, 616.24, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+980, sellCostBuyPrice =sellCostBuyPrice+980
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+980, sellCostMeanBuyPrice = sellCostMeanBuyPrice+980
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+882, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+918.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+882
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+616.24
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+2
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 980, 980, 980
                    , 980, 882, 918.4, 882
                    , 0, 0, 0, 0
                    , 0, 0, 0, 980, 616.24, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+980, sellCostBuyPrice =sellCostBuyPrice+980
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+980, sellCostMeanBuyPrice = sellCostMeanBuyPrice+980
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+882, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+918.4
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+882
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+616.24
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '295', userid = '3', storedetaildate = '2026-10-20 18:02:07' WHERE storedetailid = '1384';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1384', '1', '2', '1', '1129', 'اضافة فاتورة مبيعات', 'sellbillController.php', '297', '295', '3', '2026-10-20 18:02:07','0','0'); -- id=15372
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 75;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','01383', '1129', '94', '1383', '1', '330', '330', '0', '', '0', '2026-10-20 18:02:07', '1383', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','75-1,','1','1','0','0','330','330','0','','0','0.00','0','0','0','0'); -- id=4495
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 4495;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1383, '2026-10-20', 330, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 300, 300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 330, 300, 300
                    , 300, 300, 300, 300
                    , 0, 0, 0, 0
                    , 0, 0, 0, 300, 300, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+330, sellCostBuyPrice =sellCostBuyPrice+300
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+300, sellCostMeanBuyPrice = sellCostMeanBuyPrice+300
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+300, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+300
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+300
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+300
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+300
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '269', userid = '3', storedetaildate = '2026-10-20 18:02:07' WHERE storedetailid = '1383';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1383', '1', '1', '1', '1129', 'اضافة فاتورة مبيعات', 'sellbillController.php', '270', '269', '3', '2026-10-20 18:02:07','0','0'); -- id=15373
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 6709;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('260','00030', '1129', '40', '1121', '1', '290', '290', '0', '', '0', '2026-10-20 18:02:07', '1121', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6709-1,','1','1','0','0','290','290','0','','0','0.00','0','0','0','0'); -- id=4496
UPDATE sellbilldetail SET  lastbuyprice = 260.00 , meanbuyprice = 260.23, lastbuyprice_withDiscount = 260.00, meanbuyprice_withDiscount = 260.23
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260.23, lastbuyprice_withDiscountAndTax = 260
                where sellbilldetailid = 4496;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1121, '2026-10-20', 290, 260, 260
                    , 260.23, 260, 260.23, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 260, 260.23, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260.23
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260.23
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260.23
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 290, 260, 260
                    , 260.23, 260, 260.23, 260
                    , 0, 0, 0, 0
                    , 0, 0, 0, 260, 260.23, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+290, sellCostBuyPrice =sellCostBuyPrice+260
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+260, sellCostMeanBuyPrice = sellCostMeanBuyPrice+260.23
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+260, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+260.23
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+260
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+260
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+260.23
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '649', userid = '3', storedetaildate = '2026-10-20 18:02:07' WHERE storedetailid = '1121';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1121', '1', '1', '1', '1129', 'اضافة فاتورة مبيعات', 'sellbillController.php', '650', '649', '3', '2026-10-20 18:02:07','0','0'); -- id=15374
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','08315', '1129', '19', '829', '1', '540', '540', '0', '', '0', '2026-10-20 18:02:07', '829', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','540','540','0','','0','0.00','0','0','0','0'); -- id=4497
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 = 4497;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (829, '2026-10-20', 540, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 540, 520, 520
                    , 520, 520, 520, 520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 520, 520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+540, sellCostBuyPrice =sellCostBuyPrice+520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '65', userid = '3', storedetaildate = '2026-10-20 18:02:07' WHERE storedetailid = '829';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('829', '1', '1', '1', '1129', 'اضافة فاتورة مبيعات', 'sellbillController.php', '66', '65', '3', '2026-10-20 18:02:07','0','0'); -- id=15375
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','04188', '1129', '15', '790', '1', '260', '260', '0', '', '0', '2026-10-20 18:02:07', '790', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','260','260','0','','0','0.00','0','0','0','0'); -- id=4498
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 = 4498;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (790, '2026-10-20', 260, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 260, 240, 240
                    , 240, 240, 240, 240
                    , 0, 0, 0, 0
                    , 0, 0, 0, 240, 240, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+260, sellCostBuyPrice =sellCostBuyPrice+240
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+240, sellCostMeanBuyPrice = sellCostMeanBuyPrice+240
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+240, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+240
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+240
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+240
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+240
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '99', userid = '3', storedetaildate = '2026-10-20 18:02:07' WHERE storedetailid = '790';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('790', '1', '1', '1', '1129', 'اضافة فاتورة مبيعات', 'sellbillController.php', '100', '99', '3', '2026-10-20 18:02:07','0','0'); -- id=15376
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 6737;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('292.5','i0002262', '1129', '200', '2262', '1', '325', '325', '0', '', '0', '2026-10-20 18:02:07', '2262', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6737-1,','1','1','0','0','325','325','0','','0','0.00','0','0','0','0'); -- id=4499
UPDATE sellbilldetail SET  lastbuyprice = 325.00 , meanbuyprice = 325.00, lastbuyprice_withDiscount = 292.50, meanbuyprice_withDiscount = 292.50
        , lastbuyprice_withTax = 325, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 292.5
                where sellbilldetailid = 4499;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2262, '2026-10-20', 325, 325, 325
                    , 325, 292.5, 292.5, 292.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 325, 325, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+325
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+292.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+292.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+325
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+325
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 325, 325, 325
                    , 325, 292.5, 292.5, 292.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 325, 325, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+325, sellCostBuyPrice =sellCostBuyPrice+325
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+325, sellCostMeanBuyPrice = sellCostMeanBuyPrice+325
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+292.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+292.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+292.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+325
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+325
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '35', userid = '3', storedetaildate = '2026-10-20 18:02:07' WHERE storedetailid = '3655';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2262', '1', '1', '1', '1129', 'اضافة فاتورة مبيعات', 'sellbillController.php', '36', '35', '3', '2026-10-20 18:02:07','0','0'); -- id=15377
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7029823.5',  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 ('7027098.5','2725', '0', '2', 'اضافة فاتورة مبيعات', '1129', '7029823.5', '2026-10-20 18:02:07', '3',  'sellbillController.php','1','','0'); -- id=1392
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2725', '2725', '2026-10-20', '3', '0', '0', '2026-10-20 18:02:07','اضافة فاتورة مبيعات رقم 1129','1','0',null,'0','1129','sellbillController.php?do=showDetail&sellbillid=1129'); -- id=4005
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4005', '419', '2725', '','0'); -- id=4111
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7029823', 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 ('4005', '143', '2725', '','0'); -- id=4007
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12728090', 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 ( '2494.5', '2494.5', '2026-10-20', '3', '0', '0', '2026-10-20 18:02:07','اضافة فاتورة مبيعات رقم 1129 - صرف البضاعة من المخزن','1','0',null,'0','1129','sellbillController.php?do=showDetail&sellbillid=1129'); -- id=4006
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4006', '402', '2494.5', '','0'); -- id=4112
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11776616.11', 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 ('4006', '382', '2494.5', '','0'); -- id=4008
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24200668.59', 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='4005,0,4006' where sellbillid=1129;
 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-20', 2725, 2625, 2625
                    , 2625.23, 2494.5, 2531.13, 2494.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2625, 2261.47, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2725, sellCostBuyPrice =sellCostBuyPrice+2625
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2625, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2625.23
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2494.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2531.13
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2494.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2625
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2261.47
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2725, 2625, 2625
                    , 2625.23, 2494.5, 2531.13, 2494.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,2625, 2261.47, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2725, sellCostBuyPrice =sellCostBuyPrice+2625
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2625, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2625.23
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2494.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2531.13
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2494.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2625
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2261.47
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 2725, 2625, 2625
                    , 2625.23, 2494.5, 2531.13, 2494.5, 2625, 2261.47)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+2725, netSellCostBuyPrice = netSellCostBuyPrice+2625
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+2625
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+2625.23
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+2494.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+2531.13
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+2494.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+2625
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+2261.47;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad780f7400a9 and sellbillId = 1129 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:32:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:02:07", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:02:07', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15786
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:33:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:03:38", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 18:03:38', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15787
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:33:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:03:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:03:53', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15788
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:34:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:04:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:04:07', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15789
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:34:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:04:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storeController.php', '2026-10-20 18:04:43', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storeController.php?do=show'); -- id=15790
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:34:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:04:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 18:04:54', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15791
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:34:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:04:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 18:04:59', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15792
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:35:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:05:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:05:21', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15793
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:35:31";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:05:31", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:05:31', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15794
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:35:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:05:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:05:35', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=165'); -- id=15795
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:35:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:05:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:05:56', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=15796
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 165;
UPDATE buybill SET  buybillsysdate = '2026-10-20 18:05:56', userid = '1',delbyuserid = '1', conditions = '1' WHERE buybillid = '165';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 12:11:29', 2, 1928, 0, 0
                    , 850, 12, 0, 0, 1, '2026-10-20 18:05:56')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:05:56' ; -- id=1369
UPDATE buybilldetail SET  lastbuyprice = 850.00 , meanbuyprice = 850.00, lastbuyprice_withDiscount = 850.00, meanbuyprice_withDiscount = 850.00
        , lastbuyprice_withTax = 850.00, meanbuyprice_withTax = 425.00, lastbuyprice_withDiscountAndTax = 850.00
                where buybilldetailid = 1012;
UPDATE product SET productName = 'ترنج ملتون خالد الدولي', productDescription = '', productCatId = '155', productBuyPrice = '850.00', productSellAllPrice = '900.00', productSellUnitPrice = '900.00', productSellHalfPrice = '900.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01928',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '850',lastbuyprice_withDiscount = '0',meanbuyprice = '850',meanbuyprice_withDiscount = '850' , productbuypricereal = '850.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.88' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='850',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='850',meanbuyprice_withTax='2125',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1928';
UPDATE productunit SET proUnitBuyPrice  = 850 * productnumber WHERE productid = 1928;
UPDATE storedetail SET  productquantity = '-3', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3088';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1928', '2', '12', '1', '165', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '9', '-3', '1', '2026-10-14 12:11:29','0','0'); -- id=15378
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 12:11:29', 2, 1929, 0, 0
                    , 425, 24, 0, 0, 1, '2026-10-20 18:05:56')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:05:56' ; -- id=1367
UPDATE buybilldetail SET  lastbuyprice = 425.00 , meanbuyprice = 425.00, lastbuyprice_withDiscount = 425.00, meanbuyprice_withDiscount = 425.00
        , lastbuyprice_withTax = 425.00, meanbuyprice_withTax = 212.50, lastbuyprice_withDiscountAndTax = 425.00
                where buybilldetailid = 1013;
UPDATE product SET productName = 'سوسته هودي براند خالد الدولي', productDescription = '', productCatId = '155', productBuyPrice = '425.00', productSellAllPrice = '445.00', productSellUnitPrice = '445.00', productSellHalfPrice = '445.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01929',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '425',lastbuyprice_withDiscount = '0',meanbuyprice = '425.00',meanbuyprice_withDiscount = '425' , productbuypricereal = '425.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.71' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='425',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='425',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1929';
UPDATE productunit SET proUnitBuyPrice  = 425 * productnumber WHERE productid = 1929;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3087';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1929', '2', '24', '1', '165', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-14 12:11:29','0','0'); -- id=15379
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 12:11:29', 2, 1930, 0, 0
                    , 395, 24, 0, 0, 1, '2026-10-20 18:05:56')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-24, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:05:56' ; -- id=1365
UPDATE buybilldetail SET  lastbuyprice = 395.00 , meanbuyprice = 395.00, lastbuyprice_withDiscount = 395.00, meanbuyprice_withDiscount = 395.00
        , lastbuyprice_withTax = 395.00, meanbuyprice_withTax = 197.50, lastbuyprice_withDiscountAndTax = 395.00
                where buybilldetailid = 1014;
UPDATE product SET productName = 'هودي طباعه خالد الدولي', productDescription = '', productCatId = '155', productBuyPrice = '395.00', productSellAllPrice = '415.00', productSellUnitPrice = '415.00', productSellHalfPrice = '415.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01930',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '0',meanbuyprice = '395.00',meanbuyprice_withDiscount = '395' , productbuypricereal = '395.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.06' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',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='395',meanbuyprice_withTax='0',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1930';
UPDATE productunit SET proUnitBuyPrice  = 395 * productnumber WHERE productid = 1930;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3086';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1930', '2', '24', '1', '165', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '24', '0', '1', '2026-10-14 12:11:29','0','0'); -- id=15380
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 12:11:29', 2, 1931, 0, 0
                    , 350, 54, 0, 0, 1, '2026-10-20 18:05:56')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-54, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:05:56' ; -- id=1363
UPDATE buybilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350.00, meanbuyprice_withTax = 175.00, lastbuyprice_withDiscountAndTax = 350.00
                where buybilldetailid = 1015;
UPDATE product SET productName = 'تيشرت راوند خالد الدولي', productDescription = '', productCatId = '155', productBuyPrice = '350.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01931',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '0',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.71' , 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='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='3325',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1931';
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1931;
UPDATE storedetail SET  productquantity = '-54', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3085';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1931', '2', '54', '1', '165', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '0', '-54', '1', '2026-10-14 12:11:29','0','0'); -- id=15381
UPDATE supplier SET  suppliercurrentDebt = '168965',suppliercurrentDebtInCurrency= '168965' , userid = '1', supplierdate = '2026-10-20 18:05:56'   WHERE supplierid = '7';
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 ('7', '217745.00', '48780.00', '1', 'حذف فاتورة مشتريات - للتعديل', '165', '168965', '2026-10-14 12:11:29', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','48780','1','217745','48780','168965','0',''); -- id=761
UPDATE productserial SET del = 1
		 WHERE billid = 165;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06acf474115f23', '2026-10-14 12:11:29', '7', '168965.00', '217745', '0', '0', '48780.00', '48780.00', '0.00', '48780', '1', '2026-10-20 18:05:56', '', '1', '0', '', '1', '1','1','165','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=272
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 ('01928', '272', '155', '1928', '12.00', '850', '10200.00', '0.00', '', '2026-10-20 18:05:56', '1928','','','0','0','0','0','0',null,'850','10200','0','0','0','0','0','0','0','0','1'); -- id=1508
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 12:11:29', 1, 1928, 0, 0
                    , 850, 12, 0, 0, 1, '2026-10-20 18:05:56')
                ON DUPLICATE KEY UPDATE buyprice = 850,
                        buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:05:56' ; -- id=1115
UPDATE product SET  productBuyPrice = "850" WHERE productId = 1928 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1508 ;
UPDATE product SET productName = 'ترنج ملتون خالد الدولي', productDescription = '', productCatId = '155', productBuyPrice = '850.00', productSellAllPrice = '900.00', productSellUnitPrice = '900.00', productSellHalfPrice = '900.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01928',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '850',lastbuyprice_withDiscount = '850',meanbuyprice = '850',meanbuyprice_withDiscount = '850' , productbuypricereal = '850.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.88' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='850',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='850',meanbuyprice_withTax='1396.43',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='850',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1928';
UPDATE buybilldetail SET  lastbuyprice = 850 , meanbuyprice = 850, lastbuyprice_withDiscount = 850, meanbuyprice_withDiscount = 850
        , lastbuyprice_withTax = 850, meanbuyprice_withTax = 1396.43, lastbuyprice_withDiscountAndTax = 850
                where buybilldetailid = 1508;
UPDATE productunit SET proUnitBuyPrice  = 850 * productnumber WHERE productid = 1928;
UPDATE storedetail SET  productquantity = '12', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2945';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1928', '1', '12', '0', '272', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '12', '1', '2026-10-14 12:11:29','0','0'); -- id=15382
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 ('01929', '272', '155', '1929', '24.00', '425', '10200.00', '0.00', '', '2026-10-20 18:05:56', '1929','','','0','0','0','0','0',null,'425','10200','0','0','0','0','0','0','0','0','1'); -- id=1509
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 12:11:29', 1, 1929, 0, 0
                    , 425, 24, 0, 0, 1, '2026-10-20 18:05:56')
                ON DUPLICATE KEY UPDATE buyprice = 425,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:05:56' ; -- id=1116
UPDATE product SET  productBuyPrice = "425" WHERE productId = 1929 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1509 ;
UPDATE product SET productName = 'سوسته هودي براند خالد الدولي', productDescription = '', productCatId = '155', productBuyPrice = '425.00', productSellAllPrice = '445.00', productSellUnitPrice = '445.00', productSellHalfPrice = '445.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01929',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '425',lastbuyprice_withDiscount = '425',meanbuyprice = '425',meanbuyprice_withDiscount = '425' , productbuypricereal = '425.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.71' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='425',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='425',meanbuyprice_withTax='212.5',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='425',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1929';
UPDATE buybilldetail SET  lastbuyprice = 425 , meanbuyprice = 425, lastbuyprice_withDiscount = 425, meanbuyprice_withDiscount = 425
        , lastbuyprice_withTax = 425, meanbuyprice_withTax = 212.5, lastbuyprice_withDiscountAndTax = 425
                where buybilldetailid = 1509;
UPDATE productunit SET proUnitBuyPrice  = 425 * productnumber WHERE productid = 1929;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2946';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1929', '1', '24', '0', '272', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-14 12:11:29','0','0'); -- id=15383
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 ('01930', '272', '155', '1930', '24.00', '395', '9480.00', '0.00', '', '2026-10-20 18:05:56', '1930','','','0','0','0','0','0',null,'395','9480','0','0','0','0','0','0','0','0','1'); -- id=1510
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 12:11:29', 1, 1930, 0, 0
                    , 395, 24, 0, 0, 1, '2026-10-20 18:05:56')
                ON DUPLICATE KEY UPDATE buyprice = 395,
                        buyQuantity =buyQuantity+24, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:05:56' ; -- id=1117
UPDATE product SET  productBuyPrice = "395" WHERE productId = 1930 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1510 ;
UPDATE product SET productName = 'هودي طباعه خالد الدولي', productDescription = '', productCatId = '155', productBuyPrice = '395.00', productSellAllPrice = '415.00', productSellUnitPrice = '415.00', productSellHalfPrice = '415.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01930',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '395',lastbuyprice_withDiscount = '395',meanbuyprice = '395',meanbuyprice_withDiscount = '395' , productbuypricereal = '395.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.06' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='395',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='395',meanbuyprice_withTax='197.5',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='395',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1930';
UPDATE buybilldetail SET  lastbuyprice = 395 , meanbuyprice = 395, lastbuyprice_withDiscount = 395, meanbuyprice_withDiscount = 395
        , lastbuyprice_withTax = 395, meanbuyprice_withTax = 197.5, lastbuyprice_withDiscountAndTax = 395
                where buybilldetailid = 1510;
UPDATE productunit SET proUnitBuyPrice  = 395 * productnumber WHERE productid = 1930;
UPDATE storedetail SET  productquantity = '24', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2947';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1930', '1', '24', '0', '272', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '24', '1', '2026-10-14 12:11:29','0','0'); -- id=15384
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 ('01931', '272', '155', '1931', '54.00', '350', '18900.00', '0.00', '', '2026-10-20 18:05:56', '1931','','','0','0','0','0','0',null,'350','18900','0','0','0','0','0','0','0','0','1'); -- id=1511
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14 12:11:29', 1, 1931, 0, 0
                    , 350, 54, 0, 0, 1, '2026-10-20 18:05:56')
                ON DUPLICATE KEY UPDATE buyprice = 350,
                        buyQuantity =buyQuantity+54, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:05:56' ; -- id=1118
UPDATE product SET  productBuyPrice = "350" WHERE productId = 1931 ;
UPDATE buybilldetail SET  quantitybefore = 51 WHERE buybilldetailid = 1511 ;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:35:56";
UPDATE product SET productName = 'تيشرت راوند خالد الدولي', productDescription = '', productCatId = '155', productBuyPrice = '350.00', productSellAllPrice = '370.00', productSellUnitPrice = '370.00', productSellHalfPrice = '370.00', productDate = '2026-10-14', conditions = '0', userId = '1', limitamount = '0', parcode = '01931',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.71' , 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='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='1795',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='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 = '1931';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 350, meanbuyprice_withDiscount = 350
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 1795, lastbuyprice_withDiscountAndTax = 350
                where buybilldetailid = 1511;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 1931;
UPDATE storedetail SET  productquantity = '105', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2948';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1931', '1', '54', '0', '272', 'اضافة فاتورة مشتريات', 'buyBillController.php', '51', '105', '1', '2026-10-14 12:11:29','0','0'); -- id=15385
DELETE FROM productserial WHERE billid = 165
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '217745',suppliercurrentDebtInCurrency= '217745' , userid = '1', supplierdate = '2026-10-20 18:05:56'   WHERE supplierid = '7';
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 ('7', '168965.00', '48780', '0', 'اضافة فاتورة مشتريات', '272', '217745', '2026-10-20 18:05:56', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','48780','1','168965','48780','217745','0',''); -- id=762
UPDATE dailyentry SET totalcreditor = '48780.00', totaldebtor = '48780.00', thedate = '2026-10-14', userid = '1', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-14 20:17:00', entryComment = 'اضافة فاتورة مشتريات رقم 165', fromFlag = '1',related='0',isopeningentry='0',operationId='165',operationDetailLink='buyBillController.php?do=details&id=165' WHERE id = '2469';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '48780.00', '48780.00', '2026-10-20', '1', '0', '2469', '2026-10-20 18:05:56','تم عكس القيد رقم 2469 ','1','0','0','0','0',''); -- id=4007
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4007', '492', '48780.00', '','0'); -- id=4009
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1568631', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4007', '426', '48780.00', '','0'); -- id=4113
UPDATE accountstree SET name = 'خالد الدولي - مورد', customName = 'خالد الدولي - مورد', customNameEn = 'خالد الدولي - مورد', nameEn = 'خالد الدولي - مورد', parent = '81', accountNature = '1', theValue = '-19680', 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 = '426';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '48780', '48780', '2026-10-20', '1', '0', '0', '2026-10-20 18:05:56','اضافة فاتورة مشتريات رقم 272','1','0',null,'0','272','buyBillController.php?do=details&id=272'); -- id=4008
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4008', '382', '48780', '','0'); -- id=4114
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24249448.59', 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 ('4008', '426', '48780', '','0'); -- id=4010
UPDATE accountstree SET name = 'خالد الدولي - مورد', customName = 'خالد الدولي - مورد', customNameEn = 'خالد الدولي - مورد', nameEn = 'خالد الدولي - مورد', parent = '81', accountNature = '1', theValue = '29100', 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 = '426';
update buybill set dailyentryid='4008,0' where buybillid=272;
UPDATE product SET overAllAveragePrice = 850 WHERE productId = 1928;UPDATE product SET overAllAveragePrice = 425 WHERE productId = 1929;UPDATE product SET overAllAveragePrice = 395 WHERE productId = 1930;UPDATE product SET overAllAveragePrice = 350 WHERE productId = 1931;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:35:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:05:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:05:56', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=272'); -- id=15797
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:36:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:06:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 18:06:46', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php'); -- id=15798
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:36:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:06:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 18:06:56', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=add'); -- id=15799
BEGIN;
CALL insertUniqueOptNum(23,1,2,1928,12,'2026-10-20',1,0, '' , '' ,0,0,0,0,0,'2026-10-20 18:06:56',0,'',0,'','hide',0,@id,@optnum);
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '2945';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14', 1, 1928, 0, 0
                    , 850.00, 12, 0, 0, 1, '2026-10-20 18:06:56')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-12, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:06:56' ; -- id=1115
UPDATE storemovement SET  buyPricesHistoryBookData = "12*2026-10-14*850.00," WHERE transferproductid = 1420;
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1928', '1', '12', '1', '1420', 'تحويل منتجات من المخزن', 'storemovementController.php', '12', '0', '1', '2026-10-20','0','0'); -- id=15386
UPDATE storedetail SET  productquantity = '9', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3088';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-14', 2, 1928, 0, 0
                    , 850.00, 12, 0, 0, 1, '2026-10-20 18:06:56')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity+12, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:06:56' ; -- id=1369
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1928', '2', '12', '0', '1420', 'تحويل منتجات إلى المخزن', 'storemovementController.php', '-3', '9', '1', '2026-10-20','0','0'); -- id=15387
UPDATE storedetail SET inUse = 0 WHERE storedetailid=2945;
UPDATE storedetail SET inUse = 0 WHERE storedetailid=3088;
COMMIT;
BEGIN;
BEGIN;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10200', '10200', '2026-10-20', '1', '0', '0', '2026-10-20 18:06:56','تحويل من مخزن المخزن الرئيسي الى مخزن مخزن المحل','1','0',null,'0','23','storemovementController.php?do=show&operationnum=23'); -- id=4009
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4009', '492', '10200', '','0'); -- id=4115
UPDATE accountstree SET name = 'مخزن المحل', customName = 'مخزن المحل', customNameEn = 'مخزن المحل', nameEn = 'مخزن المحل', parent = '49', accountNature = '0', theValue = '1578831', 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 ('4009', '382', '10200', '','0'); -- id=4011
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24239248.59', 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 =4009 WHERE operationnum = 23;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:36:57";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:06:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 18:06:57', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=sucess'); -- id=15800
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:36:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:06:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storemovementController.php', '2026-10-20 18:06:58', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storemovementController.php?do=show'); -- id=15801
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:37:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:07:52", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:07:52', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15802
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:39:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:09:44", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:09:44', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1129'); -- id=15803
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:39:44";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:09:44", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:09:44', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1129'); -- id=15804
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:39:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:09:48", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:09:48', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15805
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:39:49";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:09:49", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:09:49', '3', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15806
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:41:13";
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-20 14:41:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:11:30", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 18:11:30', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15807
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-20 14:41:30";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 18:11:30', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15808
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:41:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:11:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:11:33', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15809
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:41:43";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:11:43", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:11:43', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15810
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:41:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:11:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:11:59', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15811
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:42:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:12:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 18:12:17', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15812
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:49:03";
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-20 14:49:30";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:19:30", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 18:19:30', '4', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15813
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-20 14:49:30";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 18:19:30", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 18:19:30', '4', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15814
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:49:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:19:39", deviceType = "DESKTOP" WHERE userid = 4;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:19:39', '4', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15815
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:49:47";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:19:47", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 18:19:47', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php'); -- id=15816
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:50:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:20:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 18:20:16', '1', 'add2', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=add2'); -- id=15817
INSERT INTO productcat (productCatName, productCatDate, productCatDescription, productCatParent, userId, conditions, selldiscount, buydiscount, discounttype,isOptic , buytotal , buyhalf , buypart ,buypricereal,opticServices,logo,inMenu,stopNegativeSale,catExcelid,webApiId,obygyInvestigationCatId,price4,price5,price6,price7,price8,price9,price10,price11,price12,price13) VALUES ('نيو تومي','2026-10-20','','1', '1','0', '0', '0', '-1', '0', '0', '0', '0','0','','.','0','1','0','0','0','0','0','0','0','0','0','0','0','0','0'); -- id=202
INSERT INTO onlinetempcategory (catid, edited, sysdate, userid)
                VALUES (202, 1,'2026-10-20 18:20:16',1)
                ON DUPLICATE KEY UPDATE catid = 202, edited = 1, sysdate = '2026-10-20 18:20:16', userid = 1; -- id=217
INSERT INTO productcatunit (unitid, productcatid, productnumber, productcatunitdate, userid, conditions) VALUES ('1', '202', '1', '2026-10-20', '1', '0'); -- id=94
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:50:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:20:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 18:20:16', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=sucess'); -- id=15818
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:50:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:20:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productCatController.php', '2026-10-20 18:20:18', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productCatController.php?do=show'); -- id=15819
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:51:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:21:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 18:21:07', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15820
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:56:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:26:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 18:26:56', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15821
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('وات نيو تومي','','202','260','280','0','0','2026-10-20','0','1','0','','0','0','0','0','0','260','260','260','260','260','0','7.69','0','0','.','0','0','0','260','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','260','260','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','260','0','0','0','0','0','0','','','0','0','0','0'); -- id=2280
UPDATE product SET productName = 'وات نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '260', productSellAllPrice = '280', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02280',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260',lastbuyprice_withDiscount = '260',meanbuyprice = '260',meanbuyprice_withDiscount = '260' , productbuypricereal = '260' , buypricereal_precentage = '0' , buytotal_precentage = '7.69' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='260',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='260',meanbuyprice_withTax='260',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='260',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2280';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2280', '1.00', '2026-10-20', '1', '0','0228001','280','0','0','260','','0','0','0','0','0','0','0','0','0','0'); -- id=2280
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2280', '1', '0', '1', '2026-10-20'); -- id=3673
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2280', '1', '0', '0', '2280', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15388
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2280, 1,'2026-10-20 18:26:56',1)
                ON DUPLICATE KEY UPDATE productid = 2280, edited = 1, sysdate = '2026-10-20 18:26:56', userid = 1; -- id=3357
UPDATE product SET productName = 'وات نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '260.00', productSellAllPrice = '280.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02280',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260',lastbuyprice_withDiscount = '260',meanbuyprice = '260',meanbuyprice_withDiscount = '260' , productbuypricereal = '260' , buypricereal_precentage = '0' , buytotal_precentage = '7.69' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='260',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='260',meanbuyprice_withTax='260',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='260',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2280';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('سكارف تقطيع نيو تومي','','202','370','390','0','0','2026-10-20','0','1','0','','0','0','0','0','0','370','370','370','370','370','0','5.41','0','0','.','0','0','0','370','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','370','370','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','370','0','0','0','0','0','0','','','0','0','0','0'); -- id=2281
UPDATE product SET productName = 'سكارف تقطيع نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '370', productSellAllPrice = '390', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02281',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370' , buypricereal_precentage = '0' , buytotal_precentage = '5.41' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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 = '2281';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2281', '1.00', '2026-10-20', '1', '0','0228101','390','0','0','370','','0','0','0','0','0','0','0','0','0','0'); -- id=2281
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2281', '1', '0', '1', '2026-10-20'); -- id=3674
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2281', '1', '0', '0', '2281', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15389
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2281, 1,'2026-10-20 18:26:56',1)
                ON DUPLICATE KEY UPDATE productid = 2281, edited = 1, sysdate = '2026-10-20 18:26:56', userid = 1; -- id=3358
UPDATE product SET productName = 'سكارف تقطيع نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '370.00', productSellAllPrice = '390.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02281',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '370',lastbuyprice_withDiscount = '370',meanbuyprice = '370',meanbuyprice_withDiscount = '370' , productbuypricereal = '370' , buypricereal_precentage = '0' , buytotal_precentage = '5.41' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='370',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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 = '2281';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('سكارف ساده نيو تومي','','202','360','380','0','0','2026-10-20','0','1','0','','0','0','0','0','0','360','360','360','360','360','0','5.56','0','0','.','0','0','0','360','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','360','360','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','360','0','0','0','0','0','0','','','0','0','0','0'); -- id=2282
UPDATE product SET productName = 'سكارف ساده نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '360', productSellAllPrice = '380', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02282',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '5.56' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2282';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2282', '1.00', '2026-10-20', '1', '0','0228201','380','0','0','360','','0','0','0','0','0','0','0','0','0','0'); -- id=2282
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2282', '1', '0', '1', '2026-10-20'); -- id=3675
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2282', '1', '0', '0', '2282', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15390
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2282, 1,'2026-10-20 18:26:56',1)
                ON DUPLICATE KEY UPDATE productid = 2282, edited = 1, sysdate = '2026-10-20 18:26:56', userid = 1; -- id=3359
UPDATE product SET productName = 'سكارف ساده نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '360.00', productSellAllPrice = '380.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02282',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '5.56' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2282';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('وايد ليج ال في نيو تومي','','202','360','380','0','0','2026-10-20','0','1','0','','0','0','0','0','0','360','360','360','360','360','0','5.56','0','0','.','0','0','0','360','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','360','360','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','360','0','0','0','0','0','0','','','0','0','0','0'); -- id=2283
UPDATE product SET productName = 'وايد ليج ال في نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '360', productSellAllPrice = '380', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02283',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '5.56' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2283';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2283', '1.00', '2026-10-20', '1', '0','0228301','380','0','0','360','','0','0','0','0','0','0','0','0','0','0'); -- id=2283
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2283', '1', '0', '1', '2026-10-20'); -- id=3676
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2283', '1', '0', '0', '2283', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15391
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2283, 1,'2026-10-20 18:26:56',1)
                ON DUPLICATE KEY UPDATE productid = 2283, edited = 1, sysdate = '2026-10-20 18:26:56', userid = 1; -- id=3360
UPDATE product SET productName = 'وايد ليج ال في نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '360.00', productSellAllPrice = '380.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02283',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360' , buypricereal_precentage = '0' , buytotal_precentage = '5.56' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2283';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('مو شبابي','','202','350','370','0','0','2026-10-20','0','1','0','','0','0','0','0','0','350','350','350','350','350','0','5.71','0','0','.','0','0','0','350','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','350','350','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','350','0','0','0','0','0','0','','','0','0','0','0'); -- id=2284
UPDATE product SET productName = 'مو شبابي', productDescription = '', productCatId = '202', productBuyPrice = '350', productSellAllPrice = '370', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02284',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '5.71' , 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 = '',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='1',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 = '2284';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2284', '1.00', '2026-10-20', '1', '0','0228401','370','0','0','350','','0','0','0','0','0','0','0','0','0','0'); -- id=2284
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2284', '1', '0', '1', '2026-10-20'); -- id=3677
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2284', '1', '0', '0', '2284', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15392
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2284, 1,'2026-10-20 18:26:56',1)
                ON DUPLICATE KEY UPDATE productid = 2284, edited = 1, sysdate = '2026-10-20 18:26:56', userid = 1; -- id=3361
UPDATE product SET productName = 'مو شبابي', productDescription = '', productCatId = '202', productBuyPrice = '350.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02284',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '5.71' , 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 = '',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='1',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 = '2284';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('بيكا نيو تومي','','202','320','350','0','0','2026-10-20','0','1','0','','0','0','0','0','0','320','320','320','320','320','0','9.38','0','0','.','0','0','0','320','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','320','320','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','320','0','0','0','0','0','0','','','0','0','0','0'); -- id=2285
UPDATE product SET productName = 'بيكا نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '320', productSellAllPrice = '350', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02285',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320',meanbuyprice_withDiscount = '320' , productbuypricereal = '320' , buypricereal_precentage = '0' , buytotal_precentage = '9.38' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='320',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='320',meanbuyprice_withTax='320',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='320',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2285';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2285', '1.00', '2026-10-20', '1', '0','0228501','350','0','0','320','','0','0','0','0','0','0','0','0','0','0'); -- id=2285
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2285', '1', '0', '1', '2026-10-20'); -- id=3678
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2285', '1', '0', '0', '2285', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15393
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2285, 1,'2026-10-20 18:26:56',1)
                ON DUPLICATE KEY UPDATE productid = 2285, edited = 1, sysdate = '2026-10-20 18:26:56', userid = 1; -- id=3362
UPDATE product SET productName = 'بيكا نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '320.00', productSellAllPrice = '350.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02285',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320',meanbuyprice_withDiscount = '320' , productbuypricereal = '320' , buypricereal_precentage = '0' , buytotal_precentage = '9.38' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='320',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='320',meanbuyprice_withTax='320',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='320',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2285';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('بنسياجه تطريز','','202','380','400','0','0','2026-10-20','0','1','0','','0','0','0','0','0','380','380','380','380','380','0','5.26','0','0','.','0','0','0','380','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','380','380','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','380','0','0','0','0','0','0','','','0','0','0','0'); -- id=2286
UPDATE product SET productName = 'بنسياجه تطريز', productDescription = '', productCatId = '202', productBuyPrice = '380', productSellAllPrice = '400', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02286',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380' , buypricereal_precentage = '0' , buytotal_precentage = '5.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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 = '2286';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2286', '1.00', '2026-10-20', '1', '0','0228601','400','0','0','380','','0','0','0','0','0','0','0','0','0','0'); -- id=2286
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2286', '1', '0', '1', '2026-10-20'); -- id=3679
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2286', '1', '0', '0', '2286', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15394
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2286, 1,'2026-10-20 18:26:56',1)
                ON DUPLICATE KEY UPDATE productid = 2286, edited = 1, sysdate = '2026-10-20 18:26:56', userid = 1; -- id=3363
UPDATE product SET productName = 'بنسياجه تطريز', productDescription = '', productCatId = '202', productBuyPrice = '380.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02286',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '380',lastbuyprice_withDiscount = '380',meanbuyprice = '380',meanbuyprice_withDiscount = '380' , productbuypricereal = '380' , buypricereal_precentage = '0' , buytotal_precentage = '5.26' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='380',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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 = '2286';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('ولكر نيو تومي','','202','350','370','0','0','2026-10-20','0','1','0','','0','0','0','0','0','350','350','350','350','350','0','5.71','0','0','.','0','0','0','350','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','350','350','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','350','0','0','0','0','0','0','','','0','0','0','0'); -- id=2287
UPDATE product SET productName = 'ولكر نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '350', productSellAllPrice = '370', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02287',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '5.71' , 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 = '',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='1',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 = '2287';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2287', '1.00', '2026-10-20', '1', '0','0228701','370','0','0','350','','0','0','0','0','0','0','0','0','0','0'); -- id=2287
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2287', '1', '0', '1', '2026-10-20'); -- id=3680
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2287', '1', '0', '0', '2287', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15395
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2287, 1,'2026-10-20 18:26:56',1)
                ON DUPLICATE KEY UPDATE productid = 2287, edited = 1, sysdate = '2026-10-20 18:26:56', userid = 1; -- id=3364
UPDATE product SET productName = 'ولكر نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '350.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02287',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350' , buypricereal_precentage = '0' , buytotal_precentage = '5.71' , 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 = '',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='1',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 = '2287';
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('نيو سكاي نيو تومي','','202','275','295','0','0','2026-10-20','0','1','0','','0','0','0','0','0','275','275','275','275','275','0','7.27','0','0','.','0','0','0','275','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','275','275','0','0','0','0','0','0','0','1','0','0','0','0','0','0','','275','0','0','0','0','0','0','','','0','0','0','0'); -- id=2288
UPDATE product SET productName = 'نيو سكاي نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '275', productSellAllPrice = '295', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02288',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '275',lastbuyprice_withDiscount = '275',meanbuyprice = '275',meanbuyprice_withDiscount = '275' , productbuypricereal = '275' , buypricereal_precentage = '0' , buytotal_precentage = '7.27' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='275',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='275',meanbuyprice_withTax='275',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='275',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2288';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2288', '1.00', '2026-10-20', '1', '0','0228801','295','0','0','275','','0','0','0','0','0','0','0','0','0','0'); -- id=2288
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2288', '1', '0', '1', '2026-10-20'); -- id=3681
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2288', '1', '0', '0', '2288', 'إضافة منتج', 'productController.php', '0', '0', '1', '2026-10-20','0','0'); -- id=15396
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2288, 1,'2026-10-20 18:26:56',1)
                ON DUPLICATE KEY UPDATE productid = 2288, edited = 1, sysdate = '2026-10-20 18:26:56', userid = 1; -- id=3365
UPDATE product SET productName = 'نيو سكاي نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '275.00', productSellAllPrice = '295.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02288',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '275',lastbuyprice_withDiscount = '275',meanbuyprice = '275',meanbuyprice_withDiscount = '275' , productbuypricereal = '275' , buypricereal_precentage = '0' , buytotal_precentage = '7.27' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='275',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='275',meanbuyprice_withTax='275',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='275',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2288';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:56:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:26:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 18:26:58', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15822
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:57:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:27:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:27:03', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15823
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:57:41";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:27:41", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:27:41', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15824
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:57:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:27:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 18:27:59', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15825
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:58:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:28:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 18:28:10', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15826
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:59:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:29:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:29:24', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15827
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:59:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:29:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:29:33', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15828
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:59:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:29:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:29:37', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15829
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 14:59:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:29:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:29:55', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15830
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:00:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:30:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:30:10', '1', 'details', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=details&id=246'); -- id=15831
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:00:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:30:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:30:25', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=show'); -- id=15832
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:00:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:30:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:30:37', '1', 'editbill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editbill&id=246'); -- id=15833
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:00:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:30:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:30:58', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=update'); -- id=15834
BEGIN;
UPDATE costcenterdetail SET del = 1 WHERE type in( 3) and  modelid = 246;
UPDATE buybill SET  buybillsysdate = '2026-10-20 18:30:59', userid = '5',delbyuserid = '1', conditions = '1' WHERE buybillid = '246';
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-19 15:19:16', 1, 1491, 0, 0
                    , 675, 30, 0, 0, 1, '2026-10-20 18:30:59')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-30, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:30:59' ; -- id=6636
UPDATE product SET productName = 'جاكيت تمبو 700', productDescription = '', productCatId = '108', productBuyPrice = '675.00', productSellAllPrice = '700.00', productSellUnitPrice = '700.00', productSellHalfPrice = '700.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01491',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '675',lastbuyprice_withDiscount = '675',meanbuyprice = '675',meanbuyprice_withDiscount = '675' , productbuypricereal = '675.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.70' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='675',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='675',meanbuyprice_withTax='675',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='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1491';
UPDATE productunit SET proUnitBuyPrice  = 675 * productnumber WHERE productid = 1491;
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1491', '1', '30', '1', '246', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '48', '18', '1', '2026-10-19 15:19:16','0','0'); -- id=15397
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-19 15:19:16', 1, 1462, 0, 0
                    , 410, 72, 0, 0, 1, '2026-10-20 18:30:59')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-72, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:30:59' ; -- id=6637
UPDATE product SET productName = 'تي شيرت ميلتون تمبو 430', productDescription = '', productCatId = '103', productBuyPrice = '410.00', productSellAllPrice = '430.00', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01462',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.88' , 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='1',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='0',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1462';
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1462;
UPDATE storedetail SET  productquantity = '102', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '72', '1', '246', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '174', '102', '1', '2026-10-19 15:19:16','0','0'); -- id=15398
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-19 15:19:16', 1, 2237, 0, 0
                    , 460, 72, 0, 0, 1, '2026-10-20 18:30:59')
                ON DUPLICATE KEY UPDATE buyQuantity =buyQuantity-72, sellQuantity = sellQuantity-0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:30:59' ; -- id=6638
UPDATE buybilldetail SET  lastbuyprice = 460.00 , meanbuyprice = 460.00, lastbuyprice_withDiscount = 460.00, meanbuyprice_withDiscount = 460.00
        , lastbuyprice_withTax = 460.00, meanbuyprice_withTax = 460.00, lastbuyprice_withDiscountAndTax = 460.00
                where buybilldetailid = 1415;
UPDATE product SET productName = 'موديل 480 تمبو', productDescription = '', productCatId = '103', productBuyPrice = '460.00', productSellAllPrice = '480.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-19', conditions = '0', userId = '5', limitamount = '0', parcode = '02237',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '0',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.35' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='0',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2237';
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 2237;
UPDATE storedetail SET  productquantity = '-18', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2237', '1', '72', '1', '246', 'حذف فاتورة مشتريات - للتعديل', 'buyBillController.php', '54', '-18', '1', '2026-10-19 15:19:16','0','0'); -- id=15399
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '2026-10-20 18:30:58'   WHERE supplierid = '1';
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 ('1', '82890.00', '82890.00', '1', 'حذف فاتورة مشتريات - للتعديل', '246', '0', '2026-10-19 15:19:16', '1', 'buyBillController.php', 'حذف فاتورة مشتريات - للتعديل', '0','', '0','1','1','82890','1','82890','82890','0','0',''); -- id=763
UPDATE productserial SET del = 1
		 WHERE billid = 246;
INSERT INTO buybill (buybillSerial, buybilldate, buybillsupplierid, buybilltotaldeptbefor, buybilltotaldeptafter, buybilldiscount, buybilldiscountrype, buybilltotalbill, buybillaftertotalbill, buybilltotalpayed, buybillfinalbill, buybillstoreid, buybillsysdate,comment, userid, conditions, buybillclientname, buybillsaveid, buybilldirectpayment, billnameid,deletedbuyid,controlname,payedtax,costcenterid,currencyId,taxOfDiscountPer,taxOfDiscountVal,files,client,totalBuyDiscountVal,webApiId,buybilladdition,buybilladditiontrype,tagids) VALUES ('06ad60ac49b866', '2026-10-19 15:19:16', '106', '-1126200.00', '-1043310', '0', '0', '82890.00', '82890.00', '0.00', '82890', '1', '2026-10-20 18:30:58', '', '1', '0', '', '1', '1','1','246','buyBillController.php','0.00','-1','1','0','0','.','0','0','0','0','0','0'); -- id=273
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 ('01491', '273', '108', '1491', '30.00', '675', '20250.00', '0.00', '', '2026-10-20 18:30:58', '1491','','','0','0','0','0','0',null,'675','20250','0','0','0','0','0','0','0','0','1'); -- id=1512
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-19 15:19:16', 1, 1491, 0, 0
                    , 675, 30, 0, 0, 1, '2026-10-20 18:30:59')
                ON DUPLICATE KEY UPDATE buyprice = 675,
                        buyQuantity =buyQuantity+30, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:30:59' ; -- id=6636
UPDATE product SET  productBuyPrice = "675" WHERE productId = 1491 ;
UPDATE buybilldetail SET  quantitybefore = 18 WHERE buybilldetailid = 1512 ;
UPDATE product SET productName = 'جاكيت تمبو 700', productDescription = '', productCatId = '108', productBuyPrice = '675.00', productSellAllPrice = '700.00', productSellUnitPrice = '700.00', productSellHalfPrice = '700.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01491',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '675',lastbuyprice_withDiscount = '675',meanbuyprice = '675',meanbuyprice_withDiscount = '675' , productbuypricereal = '675.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '3.70' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='675',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='675',meanbuyprice_withTax='675',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='675',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '1491';
UPDATE buybilldetail SET  lastbuyprice = 675 , meanbuyprice = 675, lastbuyprice_withDiscount = 675, meanbuyprice_withDiscount = 675
        , lastbuyprice_withTax = 675, meanbuyprice_withTax = 675, lastbuyprice_withDiscountAndTax = 675
                where buybilldetailid = 1512;
UPDATE productunit SET proUnitBuyPrice  = 675 * productnumber WHERE productid = 1491;
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1516';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1491', '1', '30', '0', '273', 'اضافة فاتورة مشتريات', 'buyBillController.php', '18', '48', '1', '2026-10-19 15:19:16','0','0'); -- id=15400
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 ('01462', '273', '103', '1462', '72.00', '410', '29520.00', '0.00', '', '2026-10-20 18:30:58', '1462','','','0','0','0','0','0',null,'410','29520','0','0','0','0','0','0','0','0','1'); -- id=1513
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-19 15:19:16', 1, 1462, 0, 0
                    , 410, 72, 0, 0, 1, '2026-10-20 18:30:59')
                ON DUPLICATE KEY UPDATE buyprice = 410,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:30:59' ; -- id=6637
UPDATE product SET  productBuyPrice = "410" WHERE productId = 1462 ;
UPDATE buybilldetail SET  quantitybefore = 102 WHERE buybilldetailid = 1513 ;
UPDATE product SET productName = 'تي شيرت ميلتون تمبو 430', productDescription = '', productCatId = '103', productBuyPrice = '410.00', productSellAllPrice = '430.00', productSellUnitPrice = '430.00', productSellHalfPrice = '430.00', productDate = '2026-10-06', conditions = '0', userId = '1', limitamount = '0', parcode = '01462',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '410',lastbuyprice_withDiscount = '410',meanbuyprice = '410',meanbuyprice_withDiscount = '410' , productbuypricereal = '410.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.88' , 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='1',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 = '1462';
UPDATE buybilldetail SET  lastbuyprice = 410 , meanbuyprice = 410, lastbuyprice_withDiscount = 410, meanbuyprice_withDiscount = 410
        , lastbuyprice_withTax = 410, meanbuyprice_withTax = 410, lastbuyprice_withDiscountAndTax = 410
                where buybilldetailid = 1513;
UPDATE productunit SET proUnitBuyPrice  = 410 * productnumber WHERE productid = 1462;
UPDATE storedetail SET  productquantity = '174', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '1487';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1462', '1', '72', '0', '273', 'اضافة فاتورة مشتريات', 'buyBillController.php', '102', '174', '1', '2026-10-19 15:19:16','0','0'); -- id=15401
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 ('02237', '273', '103', '2237', '72.00', '460', '33120.00', '0.00', '', '2026-10-20 18:30:58', '2237','','','0','0','0','0','0',null,'460','33120','0','0','0','0','0','0','0','0','1'); -- id=1514
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-19 15:19:16', 1, 2237, 0, 0
                    , 460, 72, 0, 0, 1, '2026-10-20 18:30:59')
                ON DUPLICATE KEY UPDATE buyprice = 460,
                        buyQuantity =buyQuantity+72, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:30:59' ; -- id=6638
UPDATE product SET  productBuyPrice = "460" WHERE productId = 2237 ;
UPDATE buybilldetail SET  quantitybefore = -18 WHERE buybilldetailid = 1514 ;
UPDATE product SET productName = 'موديل 480 تمبو', productDescription = '', productCatId = '103', productBuyPrice = '460.00', productSellAllPrice = '480.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-19', conditions = '0', userId = '5', limitamount = '0', parcode = '02237',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '460',lastbuyprice_withDiscount = '460',meanbuyprice = '460',meanbuyprice_withDiscount = '460' , productbuypricereal = '460.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '4.35' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='460',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='460',meanbuyprice_withTax='460',price4='0',price5='0',price6='0',price7='0',price8='0',clientid='0',grantduration='0',onlinepro='0',minappearonline='0',selladdpercent='0',selldiscountpercent='0',buydiscountpercent='0',onlinecatid='-1',sellpercenttype='0',searchfiltersid='',lastbuyprice_withDiscountAndTax='460',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2237';
UPDATE buybilldetail SET  lastbuyprice = 460 , meanbuyprice = 460, lastbuyprice_withDiscount = 460, meanbuyprice_withDiscount = 460
        , lastbuyprice_withTax = 460, meanbuyprice_withTax = 460, lastbuyprice_withDiscountAndTax = 460
                where buybilldetailid = 1514;
UPDATE productunit SET proUnitBuyPrice  = 460 * productnumber WHERE productid = 2237;
UPDATE storedetail SET  productquantity = '54', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3628';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2237', '1', '72', '0', '273', 'اضافة فاتورة مشتريات', 'buyBillController.php', '-18', '54', '1', '2026-10-19 15:19:16','0','0'); -- id=15402
DELETE FROM productserial WHERE billid = 246
		and type =0 
		;
UPDATE supplier SET  suppliercurrentDebt = '-1043310',suppliercurrentDebtInCurrency= '-1043310' , userid = '1', supplierdate = '2026-10-20 18:30:58'   WHERE supplierid = '106';
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 ('106', '-1126200.00', '82890', '0', 'اضافة فاتورة مشتريات', '273', '-1043310', '2026-10-20 18:30:58', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','82890','1','-1126200','82890','-1043310','0',''); -- id=764
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '82890', '82890', '2026-10-20', '1', '0', '0', '2026-10-20 18:30:59','اضافة فاتورة مشتريات رقم 273','1','0',null,'0','273','buyBillController.php?do=details&id=273'); -- id=4010
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4010', '382', '82890', '','0'); -- id=4116
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24322138.59', 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 ('4010', '589', '82890', '','0'); -- id=4012
UPDATE accountstree SET name = 'تمبو', customName = 'تمبو', customNameEn = 'تمبو', nameEn = 'تمبو', parent = '81', accountNature = '1', theValue = '-1043310', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-07 09:33:15' WHERE id = '589';
update buybill set dailyentryid='4010,0' where buybillid=273;
UPDATE product SET overAllAveragePrice = 410 WHERE productId = 1462;UPDATE product SET overAllAveragePrice = 675 WHERE productId = 1491;UPDATE product SET overAllAveragePrice = 460 WHERE productId = 2237;;
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:00:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:30:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:30:59', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=273'); -- id=15835
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:01:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:31:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:31:06', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php'); -- id=15836
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:01:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:31:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:31:10', '1', 'bill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=bill&billnameid=1'); -- id=15837
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-20 18:31:28', '0', '', '','0','0','','','','','','','','','','0','0','1','0','0','0'); -- id=199
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 ('199', '0', '', '0', 'إضافة مورد جديد', '199', '', '2026-10-20 18:31:28', '1', 'supplierController.php', '', '0','', '0','1','1','0','1','0','0','0','0',''); -- id=765
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-20 18:31:28'); -- id=686
UPDATE supplier SET suppliername = 'نيو تومي', supplieraddress = '', supplierphone = '', suppliercurrentDebt = '0.00', supplierdetails = '', conditions = '0', userid = '1', supplierdate = '2026-10-20', dailyentryid = '0', category_id = '', typesupplier_id = '',linkedClientId = '0',inUse='0',suppliercode = '',goverareaid='',namepayeecheck = '',suppliermobile='',warrantyOfficer = '',warrantymobile='',sellername = '',sellermobile='',taxnumber = '',supplierTypeForTree='0',treeId='686',sullpierCurrencyid='1',suppliercurrentDebtInCurrency='0',webApiId='0',shippingDiscountPer='0' WHERE supplierid = '199';
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:03:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:33:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:33:55', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=add'); -- id=15838
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 ('06ad7893e25026', '2026-10-20 18:31:10', '199', '0.00', '122800', '0', '0', '122800.00',  '122800.00', '0', '122800', '1', '2026-10-20 18:33:55', '', '1', '0', '', '1','1','1','0.00','-1','0','0','1','0','0','.','0','0','0','0','0',''); -- id=274
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 ('02288', '274', '202', '2288', '40', '275', '11000.00', '0', '', '2026-10-20 18:33:55', '2288','','','0','0','0','0','0',null,'275','11000','0','0','0','0','0','0','0','0','1'); -- id=1515
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 18:31:10', 1, 2288, 0, 0
                    , 275, 40, 0, 0, 1, '2026-10-20 18:33:55')
                ON DUPLICATE KEY UPDATE buyprice = 275,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:33:55' ; -- id=6784
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2288', '275', '40', '0', 'buyBillController.php', '1515', '', '0', '0'); -- id=1111
UPDATE product SET  productBuyPrice = "275" WHERE productId = 2288 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1515 ;
UPDATE product SET productName = 'نيو سكاي نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '275.00', productSellAllPrice = '295.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02288',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '275',lastbuyprice_withDiscount = '275',meanbuyprice = '275',meanbuyprice_withDiscount = '275' , productbuypricereal = '275.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.27' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='275',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='275',meanbuyprice_withTax='275',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='275',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2288';
UPDATE buybilldetail SET  lastbuyprice = 275 , meanbuyprice = 275, lastbuyprice_withDiscount = 275, meanbuyprice_withDiscount = 275
        , lastbuyprice_withTax = 275, meanbuyprice_withTax = 275, lastbuyprice_withDiscountAndTax = 275
                where buybilldetailid = 1515;
UPDATE productunit SET proUnitBuyPrice  = 275 * productnumber WHERE productid = 2288;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3681';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2288', '1', '40', '0', '274', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15403
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 ('02280', '274', '202', '2280', '40', '260', '10400.00', '0', '', '2026-10-20 18:33:55', '2280','','','0','0','0','0','0',null,'260','10400','0','0','0','0','0','0','0','0','1'); -- id=1516
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 18:31:10', 1, 2280, 0, 0
                    , 260, 40, 0, 0, 1, '2026-10-20 18:33:55')
                ON DUPLICATE KEY UPDATE buyprice = 260,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:33:55' ; -- id=6785
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2280', '260', '40', '0', 'buyBillController.php', '1516', '', '0', '0'); -- id=1112
UPDATE product SET  productBuyPrice = "260" WHERE productId = 2280 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1516 ;
UPDATE product SET productName = 'وات نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '260.00', productSellAllPrice = '280.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02280',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '260',lastbuyprice_withDiscount = '260',meanbuyprice = '260',meanbuyprice_withDiscount = '260' , productbuypricereal = '260.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '7.69' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='260',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='260',meanbuyprice_withTax='260',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='260',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2280';
UPDATE buybilldetail SET  lastbuyprice = 260 , meanbuyprice = 260, lastbuyprice_withDiscount = 260, meanbuyprice_withDiscount = 260
        , lastbuyprice_withTax = 260, meanbuyprice_withTax = 260, lastbuyprice_withDiscountAndTax = 260
                where buybilldetailid = 1516;
UPDATE productunit SET proUnitBuyPrice  = 260 * productnumber WHERE productid = 2280;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3673';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2280', '1', '40', '0', '274', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15404
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 ('02281', '274', '202', '2281', '40', '370', '14800.00', '0', '', '2026-10-20 18:33:55', '2281','','','0','0','0','0','0',null,'370','14800','0','0','0','0','0','0','0','0','1'); -- id=1517
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 18:31:10', 1, 2281, 0, 0
                    , 370, 40, 0, 0, 1, '2026-10-20 18:33:55')
                ON DUPLICATE KEY UPDATE buyprice = 370,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:33:55' ; -- id=6786
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2281', '370', '40', '0', 'buyBillController.php', '1517', '', '0', '0'); -- id=1113
UPDATE product SET  productBuyPrice = "370" WHERE productId = 2281 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1517 ;
UPDATE product SET productName = 'سكارف تقطيع نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '370.00', productSellAllPrice = '390.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02281',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 = '5.41' , 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 = '2281';
UPDATE buybilldetail SET  lastbuyprice = 370 , meanbuyprice = 370, lastbuyprice_withDiscount = 370, meanbuyprice_withDiscount = 370
        , lastbuyprice_withTax = 370, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 370
                where buybilldetailid = 1517;
UPDATE productunit SET proUnitBuyPrice  = 370 * productnumber WHERE productid = 2281;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3674';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2281', '1', '40', '0', '274', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15405
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 ('02282', '274', '202', '2282', '40', '360', '14400.00', '0', '', '2026-10-20 18:33:55', '2282','','','0','0','0','0','0',null,'360','14400','0','0','0','0','0','0','0','0','1'); -- id=1518
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 18:31:10', 1, 2282, 0, 0
                    , 360, 40, 0, 0, 1, '2026-10-20 18:33:55')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:33:55' ; -- id=6787
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2282', '360', '40', '0', 'buyBillController.php', '1518', '', '0', '0'); -- id=1114
UPDATE product SET  productBuyPrice = "360" WHERE productId = 2282 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1518 ;
UPDATE product SET productName = 'سكارف ساده نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '360.00', productSellAllPrice = '380.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02282',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.56' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2282';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 360
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 1518;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2282;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3675';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2282', '1', '40', '0', '274', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15406
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 ('02283', '274', '202', '2283', '40', '360', '14400.00', '0', '', '2026-10-20 18:33:55', '2283','','','0','0','0','0','0',null,'360','14400','0','0','0','0','0','0','0','0','1'); -- id=1519
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 18:31:10', 1, 2283, 0, 0
                    , 360, 40, 0, 0, 1, '2026-10-20 18:33:55')
                ON DUPLICATE KEY UPDATE buyprice = 360,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:33:55' ; -- id=6788
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2283', '360', '40', '0', 'buyBillController.php', '1519', '', '0', '0'); -- id=1115
UPDATE product SET  productBuyPrice = "360" WHERE productId = 2283 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1519 ;
UPDATE product SET productName = 'وايد ليج ال في نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '360.00', productSellAllPrice = '380.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02283',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '360',lastbuyprice_withDiscount = '360',meanbuyprice = '360',meanbuyprice_withDiscount = '360' , productbuypricereal = '360.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.56' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='360',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='360',meanbuyprice_withTax='360',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='360',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2283';
UPDATE buybilldetail SET  lastbuyprice = 360 , meanbuyprice = 360, lastbuyprice_withDiscount = 360, meanbuyprice_withDiscount = 360
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where buybilldetailid = 1519;
UPDATE productunit SET proUnitBuyPrice  = 360 * productnumber WHERE productid = 2283;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3676';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2283', '1', '40', '0', '274', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15407
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 ('02284', '274', '202', '2284', '40', '350', '14000.00', '0', '', '2026-10-20 18:33:55', '2284','','','0','0','0','0','0',null,'350','14000','0','0','0','0','0','0','0','0','1'); -- id=1520
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 18:31:10', 1, 2284, 0, 0
                    , 350, 40, 0, 0, 1, '2026-10-20 18:33:55')
                ON DUPLICATE KEY UPDATE buyprice = 350,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:33:55' ; -- id=6789
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2284', '350', '40', '0', 'buyBillController.php', '1520', '', '0', '0'); -- id=1116
UPDATE product SET  productBuyPrice = "350" WHERE productId = 2284 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1520 ;
UPDATE product SET productName = 'مو شبابي', productDescription = '', productCatId = '202', productBuyPrice = '350.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02284',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.71' , 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='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='1',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 = '2284';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 350, meanbuyprice_withDiscount = 350
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where buybilldetailid = 1520;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2284;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3677';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2284', '1', '40', '0', '274', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15408
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 ('02285', '274', '202', '2285', '50', '320', '16000.00', '0', '', '2026-10-20 18:33:55', '2285','','','0','0','0','0','0',null,'320','16000','0','0','0','0','0','0','0','0','1'); -- id=1521
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 18:31:10', 1, 2285, 0, 0
                    , 320, 50, 0, 0, 1, '2026-10-20 18:33:55')
                ON DUPLICATE KEY UPDATE buyprice = 320,
                        buyQuantity =buyQuantity+50, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:33:55' ; -- id=6790
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2285', '320', '50', '0', 'buyBillController.php', '1521', '', '0', '0'); -- id=1117
UPDATE product SET  productBuyPrice = "320" WHERE productId = 2285 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1521 ;
UPDATE product SET productName = 'بيكا نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '320.00', productSellAllPrice = '350.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02285',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '320',lastbuyprice_withDiscount = '320',meanbuyprice = '320',meanbuyprice_withDiscount = '320' , productbuypricereal = '320.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '9.38' , buyhalf_precentage = '0.00' , buypart_precentage = '0.00',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='320',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '0',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='320',meanbuyprice_withTax='320',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='320',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2285';
UPDATE buybilldetail SET  lastbuyprice = 320 , meanbuyprice = 320, lastbuyprice_withDiscount = 320, meanbuyprice_withDiscount = 320
        , lastbuyprice_withTax = 320, meanbuyprice_withTax = 320, lastbuyprice_withDiscountAndTax = 320
                where buybilldetailid = 1521;
UPDATE productunit SET proUnitBuyPrice  = 320 * productnumber WHERE productid = 2285;
UPDATE storedetail SET  productquantity = '50', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3678';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2285', '1', '50', '0', '274', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '50', '1', '2026-10-20 18:31:10','0','0'); -- id=15409
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 ('02286', '274', '202', '2286', '40', '380', '15200.00', '0', '', '2026-10-20 18:33:55', '2286','','','0','0','0','0','0',null,'380','15200','0','0','0','0','0','0','0','0','1'); -- id=1522
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 18:31:10', 1, 2286, 0, 0
                    , 380, 40, 0, 0, 1, '2026-10-20 18:33:55')
                ON DUPLICATE KEY UPDATE buyprice = 380,
                        buyQuantity =buyQuantity+40, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:33:55' ; -- id=6791
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2286', '380', '40', '0', 'buyBillController.php', '1522', '', '0', '0'); -- id=1118
UPDATE product SET  productBuyPrice = "380" WHERE productId = 2286 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1522 ;
UPDATE product SET productName = 'بنسياجه تطريز', productDescription = '', productCatId = '202', productBuyPrice = '380.00', productSellAllPrice = '400.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02286',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 = '5.26' , 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 = '2286';
UPDATE buybilldetail SET  lastbuyprice = 380 , meanbuyprice = 380, lastbuyprice_withDiscount = 380, meanbuyprice_withDiscount = 380
        , lastbuyprice_withTax = 380, meanbuyprice_withTax = 380, lastbuyprice_withDiscountAndTax = 380
                where buybilldetailid = 1522;
UPDATE productunit SET proUnitBuyPrice  = 380 * productnumber WHERE productid = 2286;
UPDATE storedetail SET  productquantity = '40', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3679';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2286', '1', '40', '0', '274', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '40', '1', '2026-10-20 18:31:10','0','0'); -- id=15410
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 ('02287', '274', '202', '2287', '36', '350', '12600.00', '0', '', '2026-10-20 18:33:55', '2287','','','0','0','0','0','0',null,'350','12600','0','0','0','0','0','0','0','0','1'); -- id=1523
INSERT INTO buypriceshistorybook (theDate, storeId, productid, sizeid, colorid, buyprice, buyQuantity, sellQuantity, del, userid, sysDate)
                    VALUES ('2026-10-20 18:31:10', 1, 2287, 0, 0
                    , 350, 36, 0, 0, 1, '2026-10-20 18:33:55')
                ON DUPLICATE KEY UPDATE buyprice = 350,
                        buyQuantity =buyQuantity+36, sellQuantity = sellQuantity+0,
                        del = 0,userid = 1,sysDate = '2026-10-20 18:33:55' ; -- id=6792
INSERT INTO entryproductspurchased (productid, price, productquantity, soldquantity, tablename, modelid, expirationDate, priority, del) VALUES ('2287', '350', '36', '0', 'buyBillController.php', '1523', '', '0', '0'); -- id=1119
UPDATE product SET  productBuyPrice = "350" WHERE productId = 2287 ;
UPDATE buybilldetail SET  quantitybefore = 0 WHERE buybilldetailid = 1523 ;
UPDATE product SET productName = 'ولكر نيو تومي', productDescription = '', productCatId = '202', productBuyPrice = '350.00', productSellAllPrice = '370.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02287',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '350',lastbuyprice_withDiscount = '350',meanbuyprice = '350',meanbuyprice_withDiscount = '350' , productbuypricereal = '350.00' , buypricereal_precentage = '0.00' , buytotal_precentage = '5.71' , 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='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='1',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 = '2287';
UPDATE buybilldetail SET  lastbuyprice = 350 , meanbuyprice = 350, lastbuyprice_withDiscount = 350, meanbuyprice_withDiscount = 350
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 350
                where buybilldetailid = 1523;
UPDATE productunit SET proUnitBuyPrice  = 350 * productnumber WHERE productid = 2287;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-20' WHERE storedetailid = '3680';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2287', '1', '36', '0', '274', 'اضافة فاتورة مشتريات', 'buyBillController.php', '0', '36', '1', '2026-10-20 18:31:10','0','0'); -- id=15411
UPDATE supplier SET  suppliercurrentDebt = '122800',suppliercurrentDebtInCurrency= '122800' , userid = '1', supplierdate = '2026-10-20 18:33:55'   WHERE supplierid = '199';
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 ('199', '0.00', '122800', '0', 'اضافة فاتورة مشتريات', '274', '122800', '2026-10-20 18:31:10', '1', 'buyBillController.php', 'اضافة فاتورة مشتريات', '0','', '0','1','1','122800','1','0','122800','122800','0',''); -- id=766
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '122800', '122800', '2026-10-20', '1', '0', '0', '2026-10-20 18:33:55','اضافة فاتورة مشتريات رقم 274','1','0',null,'0','274','buyBillController.php?do=details&id=274'); -- id=4011
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4011', '382', '122800', '','0'); -- id=4117
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24444938.59', 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 ('4011', '686', '122800', '','0'); -- id=4013
UPDATE accountstree SET name = 'نيو تومي', customName = 'نيو تومي', customNameEn = 'نيو تومي', nameEn = 'نيو تومي', parent = '81', accountNature = '1', theValue = '122800', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-20 18:31:28' WHERE id = '686';
update buybill set dailyentryid='4011,0' where buybillid=274;
COMMIT;
UPDATE product SET overAllAveragePrice = 260 WHERE productId = 2280;UPDATE product SET overAllAveragePrice = 370 WHERE productId = 2281;UPDATE product SET overAllAveragePrice = 360 WHERE productId = 2282;UPDATE product SET overAllAveragePrice = 360 WHERE productId = 2283;UPDATE product SET overAllAveragePrice = 350 WHERE productId = 2284;UPDATE product SET overAllAveragePrice = 320 WHERE productId = 2285;UPDATE product SET overAllAveragePrice = 380 WHERE productId = 2286;UPDATE product SET overAllAveragePrice = 350 WHERE productId = 2287;UPDATE product SET overAllAveragePrice = 275 WHERE productId = 2288;;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:03:55";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:33:55", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('buyBillController.php', '2026-10-20 18:33:55', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/buyBillController.php?do=editprint&id=274'); -- id=15839
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:04:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:34:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 18:34:00', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=274&type=2'); -- id=15840
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:07:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:37:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 18:37:01', '1', 'showbarcodebuybill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcodebuybill&buybillid=274&type=2'); -- id=15841
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:08:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:38:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('inventoryController.php', '2026-10-20 18:38:19', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/inventoryController.php'); -- id=15842
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:08:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:38:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 18:38:45', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15843
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:09:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:39:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 18:39:32', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=add'); -- id=15844
BEGIN;
INSERT INTO product (productName,productDescription,productCatId,productBuyPrice,productSellAllPrice,productSellUnitPrice,productSellHalfPrice,productDate,conditions,userId,limitamount,parcode,type,expireDate,dailyentryId,isService,isOptic,lastbuyprice,lastbuyprice_withDiscount,meanbuyprice,meanbuyprice_withDiscount,productbuypricereal,buypricereal_precentage,buytotal_precentage,buyhalf_precentage,buypart_precentage,logo,inMenu,obygyDetectionId,hasSizeAndColor,overAllAveragePrice,reviewType,online,updatebyuser,proExcelid,proExcelParcode,webApiId,runquery,weightedDiscount,sortby,obygyInvestigationId,TypeOfBarcodeInTax,itemsymbol,barcodeInTax,productNameE,partNumber,vehicleType,company,weight,origin,hscode,power,ProductionDate,expiry,procode,lastbuyprice_withTax,meanbuyprice_withTax,price4,price5,price6,price7,price8,clientid,grantduration,onlinepro,minappearonline,selladdpercent,selldiscountpercent,buydiscountpercent,onlinecatid,sellpercenttype,searchfiltersid,lastbuyprice_withDiscountAndTax,price9,price10,price11,price12,price13,productCatIdOnline,tagids,productDescriptionE,discountType,discount,discountRatio,priceAfterDiscount) VALUES ('فولكانو جينز 1506','','28','590','610','0','0','2026-10-20','0','1','0','','0','0','0','0','0','590','590','590','590','590','0','3.39','0','0','.','0','0','0','590','0','','','0','0','0','','0','0','0','GS1','','','','0','0','0','0','','0','0','','0','','590','590','0','0','0','0','0','0','0','0','0','0','0','0','-1','0','','590','0','0','0','0','0','0','','','0','0','0','0'); -- id=2289
UPDATE product SET productName = 'فولكانو جينز 1506', productDescription = '', productCatId = '28', productBuyPrice = '590', productSellAllPrice = '610', productSellUnitPrice = '0', productSellHalfPrice = '0', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02289',type ='0', expireDate = '0' , dailyentryId = '0',isService = '0',isOptic = '0',lastbuyprice = '590',lastbuyprice_withDiscount = '590',meanbuyprice = '590',meanbuyprice_withDiscount = '590' , productbuypricereal = '590' , buypricereal_precentage = '0' , buytotal_precentage = '3.39' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='590',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='590',meanbuyprice_withTax='590',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='590',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2289';
INSERT INTO productunit (unitid, productid, productnumber, productunitdate, userid, conditions,proUnitParcode,proUnitSellAllPrice,proUnitSellHalfPrice,proUnitSellUnitPrice,proUnitBuyPrice,unitInTax,proUnitPrice4,proUnitPrice5,proUnitPrice6,proUnitPrice7,proUnitPrice8,proUnitPrice9,proUnitPrice10,proUnitPrice11,proUnitPrice12,proUnitPrice13) VALUES ('1', '2289', '1', '2026-10-20', '1', '0','0228901','610','0','0','590','','0','0','0','0','0','0','0','0','0','0'); -- id=2289
INSERT INTO storedetail (productid, storeid, productquantity, userid, storedetaildate) VALUES ('2289', '1', '5', '1', '2026-10-20'); -- id=3682
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2289', '1', '5', '0', '2289', 'إضافة منتج', 'productController.php', '0', '5', '1', '2026-10-20','0','0'); -- id=15412
INSERT INTO onlinetempproduct (productid, edited, sysdate, userid)
                VALUES (2289, 1,'2026-10-20 18:39:32',1)
                ON DUPLICATE KEY UPDATE productid = 2289, edited = 1, sysdate = '2026-10-20 18:39:32', userid = 1; -- id=3366
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '2950', '2950', '2026-10-20', '1', '0', '0', '2026-10-20 18:39:32','إضافة منتج فولكانو جينز 1506 الكمية 5','1','0','0','0','2289','productController.php?do=edit&id=2289'); -- id=4012
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4012', '382', '2950', '','0'); -- id=4118
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24447888.59', 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 ('4012', '121', '2950', '','0'); -- id=4014
UPDATE accountstree SET name = 'حساب وسيط للارصدة الافتتاحية', customName = 'حساب وسيط للارصدة الافتتاحية', customNameEn = 'Paid Capital', nameEn = 'Paid Capital', parent = '119', accountNature = '1', theValue = '10621054.65', theOrder = '0', layingOrder = '3102', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '4', itemtype2 = '0', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:37' WHERE id = '121';
UPDATE product SET productName = 'فولكانو جينز 1506', productDescription = '', productCatId = '28', productBuyPrice = '590.00', productSellAllPrice = '610.00', productSellUnitPrice = '0.00', productSellHalfPrice = '0.00', productDate = '2026-10-20', conditions = '0', userId = '1', limitamount = '0', parcode = '02289',type ='0', expireDate = '0' , dailyentryId = '4012',isService = '0',isOptic = '0',lastbuyprice = '590',lastbuyprice_withDiscount = '590',meanbuyprice = '590',meanbuyprice_withDiscount = '590' , productbuypricereal = '590' , buypricereal_precentage = '0' , buytotal_precentage = '3.39' , buyhalf_precentage = '0' , buypart_precentage = '0',logo = '.',inMenu='0', obygyDetectionId = '0',hasSizeAndColor = '0',overAllAveragePrice='590',logo1 = '',logo2 = '',logo3 = '',logo4 = '',logo5 = '',logo6 = '',logo7 = '',reviewType ='0' , online = '' , updatebyuser = '',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='590',meanbuyprice_withTax='590',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='590',price9='0',price10='0',price11='0',price12='0',price13='0',productCatIdOnline='0',tagids='',productDescriptionE='', discountType = '0', discount = '0', discountRatio = '0',priceAfterDiscount = '0' WHERE productId = '2289';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:09:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:39:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 18:39:34', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php'); -- id=15845
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:14:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:44:57", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:44:57', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15846
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:15:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:45:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 18:45:02', '1', 'oneSupplier', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15847
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:15:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:45:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 18:45:24', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15848
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:15:45";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:45:45", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 18:45:45', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php'); -- id=15849
update user set blockedByLimits = 0;
update user set blockedByLimits = 0;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:15:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:45:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 18:45:56', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15850
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-20 15:15:56";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 18:45:56", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 18:45:56', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15851
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:16:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:46:00", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:46:00', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15852
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:16:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:46:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 18:46:01', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=add'); -- id=15853
BEGIN;
CALL supplierInUse(54,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
UPDATE supplier SET  suppliercurrentDebt = '0',suppliercurrentDebtInCurrency= '0' , userid = '1', supplierdate = '26-10-20'   WHERE supplierid = '54';
UPDATE supplier SET  inUse = 0 where supplierid = 54;
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '81449', '81449', '2026-10-20', '1', '0', '0', '2026-10-20 18:46:01','تسوية عجز مورد بالخصم','1','0','0','0','0',''); -- id=4013
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4013', '473', '81449', '','0'); -- id=4119
UPDATE accountstree SET name = 'بي ايه - مورد', customName = 'بي ايه - مورد', customNameEn = 'بي ايه - مورد', nameEn = 'بي ايه - مورد', parent = '81', accountNature = '1', theValue = '-83225', 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 = '473';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4013', '146', '81449', '','0'); -- id=4015
UPDATE accountstree SET name = 'ايرادات الخصم المكتسب', customName = 'ايرادات الخصم المكتسب', customNameEn = 'Acquired Discount Revenues', nameEn = 'Acquired Discount Revenues', parent = '147', accountNature = '1', theValue = '5714483', 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 ('54', '81449.00', '81449', '1', 'تسوية عجز مورد بالخصم', '-1', '0', '2026-10-20 18:46:01', '1', 'supplierDeficitController.php', 'تصفير الحساب', '4013','', '0','1','1','81449','1','0','0','0','0',''); -- id=767
UPDATE supplierdebtchange SET supplierid = '54', supplierdebtchangebefore = '81449.00', supplierdebtchangeamount = '81449', supplierdebtchangetype = '1', processname = 'تسوية عجز مورد بالخصم', supplierdebtchangemodelid = '-1', supplierdebtchangeafter = '0', supplierdebtchangedate = '2026-10-20 18:46:01', userid = '1', tablename = 'supplierDeficitController.php', comment = 'تصفير الحساب', dailyentryid = '4013',saveid = '',currencyId='1',conversionFactor='1',payedInCurrency='81449',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='0',debtchangamountInSupplierCurrency='81449',debtchangafterInSupplierCurrency='0', paySerialNo='0',tagids='' WHERE supplierdebtchangeid = '767';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:16:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:46:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 18:46:01', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=sucess'); -- id=15854
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:16:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:46:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierDeficitController.php', '2026-10-20 18:46:02', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierDeficitController.php?do=show'); -- id=15855
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:16:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:46:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:46:11', '2', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15856

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad7708d86d17
-- ----------------------------------------------------------------------------------------------------

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-20 18:46:11', '06ad7708d86d17', '1', '0.00', '0', '0', '1', '33290.00', '33290', '33290', '0', '1', '2026-10-20 18:46:11', '', '2', '0', 'نقدي', '2', '0', '3', '0', 'نقدي', '54' ,'0','','','','','-1','0','0','0','0','0','33290','0','','0','0','33290','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1130
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','اضافة فاتورة مبيعات','1130', '0', '2026-10-20 18:46:11', '2', 'sellbillController.php', 'اضافة فاتورة مبيعات', '33290', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 18:46:11','0','0','',''); -- id=1349
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 899;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('750','01852', '1130', '143', '1852', '4', '780', '3120', '0', '', '0', '2026-10-20 18:46:11', '1852', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','899-4,','1','1','0','0','780','3120','0','','0','0.00','0','0','0','0'); -- id=4500
UPDATE sellbilldetail SET  lastbuyprice = 750.00 , meanbuyprice = 750.00, lastbuyprice_withDiscount = 750.00, meanbuyprice_withDiscount = 750.00
        , lastbuyprice_withTax = 750, meanbuyprice_withTax = 375, lastbuyprice_withDiscountAndTax = 750
                where sellbilldetailid = 4500;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1852, '2026-10-20', 3120, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 3000, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3120, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 3120, 3000, 3000
                    , 3000, 3000, 3000, 3000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3000, 1500, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3120, sellCostBuyPrice =sellCostBuyPrice+3000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1500
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '2', storedetaildate = '2026-10-20 18:46:11' WHERE storedetailid = '2869';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1852', '1', '4', '1', '1130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '4', '0', '2', '2026-10-20 18:46:11','0','0'); -- id=15413
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 901;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('780','01854', '1130', '143', '1854', '4', '810', '3240', '0', '', '0', '2026-10-20 18:46:11', '1854', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','901-4,','1','1','0','0','810','3240','0','','0','0.00','0','0','0','0'); -- id=4501
UPDATE sellbilldetail SET  lastbuyprice = 780.00 , meanbuyprice = 780.00, lastbuyprice_withDiscount = 780.00, meanbuyprice_withDiscount = 780.00
        , lastbuyprice_withTax = 780, meanbuyprice_withTax = 390, lastbuyprice_withDiscountAndTax = 780
                where sellbilldetailid = 4501;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1854, '2026-10-20', 3240, 3120, 3120
                    , 3120, 3120, 3120, 3120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 3120, 1560, 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+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 3240, 3120, 3120
                    , 3120, 3120, 3120, 3120
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3120, 1560, 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+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 18:46:11' WHERE storedetailid = '2871';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1854', '1', '4', '1', '1130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '24', '20', '2', '2026-10-20 18:46:11','0','0'); -- id=15414
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 897;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('740','01850', '1130', '143', '1850', '12', '770', '9240', '0', '', '0', '2026-10-20 18:46:11', '1850', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','897-12,','1','1','0','0','770','9240','0','','0','0.00','0','0','0','0'); -- id=4502
UPDATE sellbilldetail SET  lastbuyprice = 740.00 , meanbuyprice = 740.00, lastbuyprice_withDiscount = 740.00, meanbuyprice_withDiscount = 740.00
        , lastbuyprice_withTax = 740, meanbuyprice_withTax = 370, lastbuyprice_withDiscountAndTax = 740
                where sellbilldetailid = 4502;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1850, '2026-10-20', 9240, 8880, 8880
                    , 8880, 8880, 8880, 8880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 8880, 4440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9240, sellCostBuyPrice =sellCostBuyPrice+8880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8880
                            , 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 (1, '2026-10-20', 9240, 8880, 8880
                    , 8880, 8880, 8880, 8880
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8880, 4440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9240, sellCostBuyPrice =sellCostBuyPrice+8880
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8880, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8880
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+8880, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+8880
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+8880
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+8880
                            , 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 = '4', userid = '2', storedetaildate = '2026-10-20 18:46:11' WHERE storedetailid = '2867';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1850', '1', '12', '1', '1130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '16', '4', '2', '2026-10-20 18:46:11','0','0'); -- id=15415
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6719;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('825','02256', '1130', '198', '2256', '6', '850', '5100', '0', '', '0', '2026-10-20 18:46:11', '2256', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6719-6,','1','1','0','0','850','5100','0','','0','0.00','0','0','0','0'); -- id=4503
UPDATE sellbilldetail SET  lastbuyprice = 825.00 , meanbuyprice = 825.00, lastbuyprice_withDiscount = 825.00, meanbuyprice_withDiscount = 825.00
        , lastbuyprice_withTax = 825, meanbuyprice_withTax = 825, lastbuyprice_withDiscountAndTax = 825
                where sellbilldetailid = 4503;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2256, '2026-10-20', 5100, 4950, 4950
                    , 4950, 4950, 4950, 4950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 4950, 4950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5100, sellCostBuyPrice =sellCostBuyPrice+4950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 5100, 4950, 4950
                    , 4950, 4950, 4950, 4950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4950, 4950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5100, sellCostBuyPrice =sellCostBuyPrice+4950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 18:46:11' WHERE storedetailid = '3647';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2256', '1', '6', '1', '1130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '118', '112', '2', '2026-10-20 18:46:11','0','0'); -- id=15416
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('565','09783', '1130', '8', '751', '5', '585', '2925', '0', '', '0', '2026-10-20 18:46:11', '751', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','585','2925','0','','0','0.00','0','0','0','0'); -- id=4504
UPDATE sellbilldetail SET  lastbuyprice = 565.00 , meanbuyprice = 565.00, lastbuyprice_withDiscount = 565.00, meanbuyprice_withDiscount = 565.00
        , lastbuyprice_withTax = 565, meanbuyprice_withTax = 565, lastbuyprice_withDiscountAndTax = 565
                where sellbilldetailid = 4504;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (751, '2026-10-20', 2925, 2825, 2825
                    , 2825, 2825, 2825, 2825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2825, 2825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2925, sellCostBuyPrice =sellCostBuyPrice+2825
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2825
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2825
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2825
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2825
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2925, 2825, 2825
                    , 2825, 2825, 2825, 2825
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2825, 2825, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2925, sellCostBuyPrice =sellCostBuyPrice+2825
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2825, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2825
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2825, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2825
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2825
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2825
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2825
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 18:46:11' WHERE storedetailid = '751';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('751', '1', '5', '1', '1130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-20 18:46:11','0','0'); -- id=15417
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 213;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('485','01432', '1130', '100', '1432', '3', '515', '1545', '0', '', '0', '2026-10-20 18:46:11', '1432', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','213-3,','1','1','0','0','515','1545','0','','0','0.00','0','0','0','0'); -- id=4505
UPDATE sellbilldetail SET  lastbuyprice = 485.00 , meanbuyprice = 482.50, lastbuyprice_withDiscount = 485.00, meanbuyprice_withDiscount = 482.50
        , lastbuyprice_withTax = 482.5, meanbuyprice_withTax = 482.5, lastbuyprice_withDiscountAndTax = 485
                where sellbilldetailid = 4505;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1432, '2026-10-20', 1545, 1440, 1455
                    , 1447.5, 1455, 1447.5, 1455
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1447.5, 1447.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1545, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1455, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1447.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1447.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1455
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1447.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1447.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+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-20', 1545, 1440, 1455
                    , 1447.5, 1455, 1447.5, 1455
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1447.5, 1447.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1545, sellCostBuyPrice =sellCostBuyPrice+1440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1455, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1447.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1455, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1447.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1455
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1447.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1447.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '2', storedetaildate = '2026-10-20 18:46:11' WHERE storedetailid = '1445';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1432', '1', '3', '1', '1130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '9', '6', '2', '2026-10-20 18:46:11','0','0'); -- id=15418
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 427;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('302.25','01586', '1130', '115', '1586', '6', '325', '1950', '0', '', '0', '2026-10-20 18:46:11', '1586', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','427-6,','1','1','0','0','325','1950','0','','0','0.00','0','0','0','0'); -- id=4506
UPDATE sellbilldetail SET  lastbuyprice = 325.00 , meanbuyprice = 325.00, lastbuyprice_withDiscount = 302.25, meanbuyprice_withDiscount = 302.25
        , lastbuyprice_withTax = 325, meanbuyprice_withTax = 325, lastbuyprice_withDiscountAndTax = 302.25
                where sellbilldetailid = 4506;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1586, '2026-10-20', 1950, 1950, 1950
                    , 1950, 1813.5, 1813.5, 1813.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1950, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1813.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1813.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1813.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1950, 1950, 1950
                    , 1950, 1813.5, 1813.5, 1813.5
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1950, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1813.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1813.5
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1813.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '2', storedetaildate = '2026-10-20 18:46:11' WHERE storedetailid = '1611';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1586', '1', '6', '1', '1130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '33', '27', '2', '2026-10-20 18:46:11','0','0'); -- id=15419
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6645;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','02242', '1130', '72', '2242', '6', '340', '2040', '0', '', '0', '2026-10-20 18:46:11', '2242', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6645-6,','1','1','0','0','340','2040','0','','0','0.00','0','0','0','0'); -- id=4507
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 306.00, meanbuyprice_withDiscount = 306.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 340, lastbuyprice_withDiscountAndTax = 306
                where sellbilldetailid = 4507;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2242, '2026-10-20', 2040, 2040, 2040
                    , 2040, 1836, 1836, 1836
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2040, 2040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2040, sellCostBuyPrice =sellCostBuyPrice+2040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1836, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1836
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1836
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2040, 2040, 2040
                    , 2040, 1836, 1836, 1836
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2040, 2040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2040, sellCostBuyPrice =sellCostBuyPrice+2040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1836, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1836
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1836
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '33', userid = '2', storedetaildate = '2026-10-20 18:46:11' WHERE storedetailid = '3633';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2242', '1', '6', '1', '1130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '39', '33', '2', '2026-10-20 18:46:11','0','0'); -- id=15420
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+3 where id = 584;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('324','01721', '1130', '49', '1721', '3', '360', '1080', '0', '', '0', '2026-10-20 18:46:11', '1721', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','584-3,','1','1','0','0','360','1080','0','','0','0.00','0','0','0','0'); -- id=4508
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 324.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 324
                where sellbilldetailid = 4508;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1721, '2026-10-20', 1080, 1080, 1080
                    , 1080, 972, 972, 972
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1080, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+972, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+972
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+972
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 1080, 1080, 1080
                    , 1080, 972, 972, 972
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1080, 1080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1080, sellCostBuyPrice =sellCostBuyPrice+1080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+972, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+972
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+972
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '183', userid = '2', storedetaildate = '2026-10-20 18:46:11' WHERE storedetailid = '2733';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1721', '1', '3', '1', '1130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '186', '183', '2', '2026-10-20 18:46:11','0','0'); -- id=15421
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('590','i0002289', '1130', '28', '2289', '5', '610', '3050', '0', '', '0', '2026-10-20 18:46:11', '2289', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','610','3050','0','','0','0.00','0','0','0','0'); -- id=4509
UPDATE sellbilldetail SET  lastbuyprice = 590.00 , meanbuyprice = 590.00, lastbuyprice_withDiscount = 590.00, meanbuyprice_withDiscount = 590.00
        , lastbuyprice_withTax = 590, meanbuyprice_withTax = 590, lastbuyprice_withDiscountAndTax = 590
                where sellbilldetailid = 4509;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2289, '2026-10-20', 3050, 2950, 2950
                    , 2950, 2950, 2950, 2950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 2950, 2950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3050, sellCostBuyPrice =sellCostBuyPrice+2950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 3050, 2950, 2950
                    , 2950, 2950, 2950, 2950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2950, 2950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3050, sellCostBuyPrice =sellCostBuyPrice+2950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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-20 18:46:11' WHERE storedetailid = '3682';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2289', '1', '5', '1', '1130', 'اضافة فاتورة مبيعات', 'sellbillController.php', '5', '0', '2', '2026-10-20 18:46:11','0','0'); -- id=15422
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7063113.5',  userid = '2' WHERE saveid = '2';
UPDATE save SET  inUse = 0 where saveid = 2;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('7029823.5','33290', '0', '2', 'اضافة فاتورة مبيعات', '1130', '7063113.5', '2026-10-20 18:46:11', '2',  'sellbillController.php','1','','0'); -- id=1393
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '33290', '33290', '2026-10-20', '2', '0', '0', '2026-10-20 18:46:11','اضافة فاتورة مبيعات رقم 1130','1','0',null,'0','1130','sellbillController.php?do=showDetail&sellbillid=1130'); -- id=4014
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4014', '419', '33290', '','0'); -- id=4120
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7063113', 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 ('4014', '143', '33290', '','0'); -- id=4016
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12761380', 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 ( '31801.5', '31801.5', '2026-10-20', '2', '0', '0', '2026-10-20 18:46:11','اضافة فاتورة مبيعات رقم 1130 - صرف البضاعة من المخزن','1','0',null,'0','1130','sellbillController.php?do=showDetail&sellbillid=1130'); -- id=4015
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4015', '402', '31801.5', '','0'); -- id=4121
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11808417.61', 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 ('4015', '382', '31801.5', '','0'); -- id=4017
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24416087.09', 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='4014,0,4015' where sellbillid=1130;
 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-20', 33290, 32235, 32250
                    , 32242.5, 31801.5, 31794, 31801.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,32242.5, 24742.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+33290, sellCostBuyPrice =sellCostBuyPrice+32235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+32250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+32242.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+31801.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+31794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+31801.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+32242.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+24742.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitclient (clientId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount,returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 33290, 32235, 32250
                    , 32242.5, 31801.5, 31794, 31801.5
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,32242.5, 24742.5, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+33290, sellCostBuyPrice =sellCostBuyPrice+32235
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+32250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+32242.5
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+31801.5, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+31794
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+31801.5
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+32242.5
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+24742.5
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
 INSERT INTO quickprofitgeneral (id, netSellVal, netSellCostBuyPrice, netSellCostLastBuyPrice, netSellCostMeanBuyPrice, netSellCostLastBuyPricewithDiscount, netSellCostMeanBuyPricewithDiscount, netSellCostOverAllAveragePrice,netSellCostLastBuyPricewithTax,netSellCostMeanBuyPricewithTax)
                    VALUES (1, 33290, 32235, 32250
                    , 32242.5, 31801.5, 31794, 31801.5, 32242.5, 24742.5)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+33290, netSellCostBuyPrice = netSellCostBuyPrice+32235
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+32250
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+32242.5
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+31801.5
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+31794
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+31801.5
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+32242.5
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+24742.5;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad7708d86d17 and sellbillId = 1130 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:16:11";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:46:11", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:46:11', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15857
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:16:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:46:20", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:46:20', '2', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1130'); -- id=15858
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:16:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:46:56", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 18:46:56', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15859
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:16:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:46:56", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('savedailyController.php', '2026-10-20 18:46:56', '3', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/savedailyController.php'); -- id=15860
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:17:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:47:01", deviceType = "DESKTOP" WHERE userid = 3;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:47:01', '3', 'showDetail', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=showDetail&sellbillid=1130'); -- id=15861
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-20 15:18:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:48:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 18:48:33', '2', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15862
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-20 15:18:33";
UPDATE user SET loginip = "51.89.20.165", lastactivetime = "2026-10-20 18:48:33", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 18:48:33', '2', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15863
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:18:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 18:48:36", deviceType = "DESKTOP" WHERE userid = 2;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 18:48:36', '2', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15864
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:33:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:03:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('productController.php', '2026-10-20 19:03:50', '1', 'showbarcode', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/productController.php?do=showbarcode'); -- id=15865
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:34:09";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:04:09", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:04:09', '1', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15866
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:35:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:05:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:05:20', '1', 'addAndRetuen', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addAndRetuen'); -- id=15867

-- ----------------------------------------------------------------------------------------------------
-- bill add start - with serial 06ad790f954973
-- ----------------------------------------------------------------------------------------------------

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-20 19:05:20', '06ad790f954973', '1', '0.00', '0', '0', '1', '8190.00', '8190', '8190', '0', '1', '2026-10-20 19:05:20', '', '1', '0', 'نقدي', '1', '0', '3', '0', 'نقدي', '21' ,'0','','','','','-1','0','0','0','0','0','8190','0','','0','0','8190','0','0','0','0','0','0','0','0','','','','0','','0','','0','-1','2026-10-20','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=1131
UPDATE client SET  clientdebt = '0', userid = '1' 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','اضافة فاتورة مبيعات','1131', '0', '2026-10-20 19:05:20', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات', '8190', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-20 19:05:20','0','0','',''); -- id=1350
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6227;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('404.8','02139', '1131', '184', '2139', '6', '440', '2640', '0', '', '0', '2026-10-20 19:05:20', '2139', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6227-6,','1','1','0','0','440','2640','0','','0','0.00','0','0','0','0'); -- id=4510
UPDATE sellbilldetail SET  lastbuyprice = 440.00 , meanbuyprice = 440.00, lastbuyprice_withDiscount = 440.00, meanbuyprice_withDiscount = 440.00
        , lastbuyprice_withTax = 440, meanbuyprice_withTax = 440, lastbuyprice_withDiscountAndTax = 440
                where sellbilldetailid = 4510;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2139, '2026-10-20', 2640, 2640, 2640
                    , 2640, 2640, 2640, 2640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2640, 2640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2640, sellCostBuyPrice =sellCostBuyPrice+2640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2640, 2640, 2640
                    , 2640, 2640, 2640, 2640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2640, 2640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2640, sellCostBuyPrice =sellCostBuyPrice+2640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '66', userid = '1', storedetaildate = '2026-10-20 19:05:20' WHERE storedetailid = '3498';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2139', '1', '6', '1', '1131', 'اضافة فاتورة مبيعات', 'sellbillController.php', '72', '66', '1', '2026-10-20 19:05:20','0','0'); -- id=15423
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+15 where id = 1118;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01931', '1131', '155', '1931', '15', '370', '5550', '0', '', '0', '2026-10-20 19:05:20', '1931', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1118-15,','1','1','0','0','370','5550','0','','0','0.00','0','0','0','0'); -- id=4511
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 350.00, meanbuyprice_withDiscount = 350.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 1795, lastbuyprice_withDiscountAndTax = 350
                where sellbilldetailid = 4511;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1931, '2026-10-20', 5550, 5250, 5250
                    , 5250, 5250, 5250, 5250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 15, 0, 5250, 26925, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5550, sellCostBuyPrice =sellCostBuyPrice+5250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26925
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (1, '2026-10-20', 5550, 5250, 5250
                    , 5250, 5250, 5250, 5250
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5250, 26925, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5550, sellCostBuyPrice =sellCostBuyPrice+5250
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5250, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5250
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5250, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5250
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5250
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5250
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+26925
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '90', userid = '1', storedetaildate = '2026-10-20 19:05:20' WHERE storedetailid = '2948';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1931', '1', '15', '1', '1131', 'اضافة فاتورة مبيعات', 'sellbillController.php', '105', '90', '1', '2026-10-20 19:05:20','0','0'); -- id=15424
CALL saveInUse(1,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '-41245306',  userid = '1' WHERE saveid = '1';
UPDATE save SET  inUse = 0 where saveid = 1;
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41253496','8190', '0', '1', 'اضافة فاتورة مبيعات', '1131', '-41245306', '2026-10-20 19:05:21', '1',  'sellbillController.php','1','','0'); -- id=1394
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '8190', '8190', '2026-10-20', '1', '0', '0', '2026-10-20 19:05:21','اضافة فاتورة مبيعات رقم 1131','1','0',null,'0','1131','sellbillController.php?do=showDetail&sellbillid=1131'); -- id=4016
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4016', '383', '8190', '','0'); -- id=4122
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41245309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4016', '143', '8190', '','0'); -- id=4018
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12769570', 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 ( '7890', '7890', '2026-10-20', '1', '0', '0', '2026-10-20 19:05:21','اضافة فاتورة مبيعات رقم 1131 - صرف البضاعة من المخزن','1','0',null,'0','1131','sellbillController.php?do=showDetail&sellbillid=1131'); -- id=4017
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4017', '402', '7890', '','0'); -- id=4123
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11816307.61', 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 ('4017', '382', '7890', '','0'); -- id=4019
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24408197.09', 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='4016,0,4017' where sellbillid=1131;
 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-20', 8190, 7890, 7890
                    , 7890, 7890, 7890, 7890
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7890, 29565, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8190, sellCostBuyPrice =sellCostBuyPrice+7890
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7890, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7890
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7890
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+29565
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 8190, 7890, 7890
                    , 7890, 7890, 7890, 7890
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,7890, 29565, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8190, sellCostBuyPrice =sellCostBuyPrice+7890
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7890, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7890
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7890
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+29565
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 8190, 7890, 7890
                    , 7890, 7890, 7890, 7890, 7890, 29565)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+8190, netSellCostBuyPrice = netSellCostBuyPrice+7890
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+7890
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+7890
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+7890
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+7890
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+7890
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+7890
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+29565;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill add end - with serial 06ad790f954973 and sellbillId = 1131 and returnsellbillId = 
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:35:21";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:05:21", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:05:21', '1', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15868
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:39:12";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:09:12", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:09:12', '1', 'addsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=addsellBill&billnameid=3'); -- id=15869
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:42:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:12:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:12:04', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=15870
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:42:06";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:12:06", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:12:06', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=15871
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:46:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:16:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2026-10-20 19:16:16', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnsellbillController.php?do=show'); -- id=15872
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:46:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:16:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2026-10-20 19:16:17', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnsellbillController.php?do=show'); -- id=15873
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:47:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:17:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:17:38', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=15874
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:47:40";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:17:40", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:17:40', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=15875
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:47:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:17:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:17:53', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=15876
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:48:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:18:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:18:22', '1', 'editsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=1092'); -- id=15877
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:48:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:18:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:18:50', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=15878
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 1092;
UPDATE sellbill SET  sellbillsysdate = '2026-10-20 19:18:50', userid = '2',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '1092';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 where id = 6548;
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 = 4362;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2235, '2026-10-20', 4050, 3780, 3780
                    , 3780, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0,9,0, 3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4050, sellCostBuyPrice =sellCostBuyPrice-3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3780
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 4050, 3780, 3780
                    , 3780, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4050, sellCostBuyPrice =sellCostBuyPrice-3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3780
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:18:50' WHERE storedetailid = '3626';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2235', '1', '9', '0', '1092', 'تعديل فاتورة مبيعات', 'sellbillController.php', '6', '15', '1', '2026-10-19 22:15:13','0','0'); -- id=15425
UPDATE client SET  clientdebt = '0', userid = '1' 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.00','1','تعديل فاتورة مبيعات','1092', '0', '2026-10-19 22:15:13', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '4050', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-19 22:15:13','0','0','',''); -- id=1351
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '7059063.5',  userid = '1' 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 ('7063113.5','4050', '1', '2', 'تعديل فاتورة مبيعات', '1092', '7059063.5', '2026-10-20 19:18:50', '1',  'sellbillController.php','1','','0'); -- id=1395
 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-20', 4050, 3780, 3780
                    , 3780, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4050, sellCostBuyPrice =sellCostBuyPrice-3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3780
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 4050, 3780, 3780
                    , 3780, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4050, sellCostBuyPrice =sellCostBuyPrice-3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3780
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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, 4050, 3780, 3780
                    , 3780, 3780, 3780, 3780, 3780, 3780)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-4050, netSellCostBuyPrice = netSellCostBuyPrice-3780
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-3780
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-3780
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-3780
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-3780
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-3780
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-3780
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-3780;

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


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

COMMIT;
BEGIN;
CALL clientInUse(17,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-19 22:15:13', '06ad66a03cf8c5', '17', '12890.00', '16940', '0', '1', '4050', '4050', '0', '4050', '1', '2026-10-19 22:15:13', '', '1', '0', 'عنتر - العملاء', '2', '1', '3', '0', 'عنتر - العملاء', '9', '1092', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-10-19','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','0',''); -- id=1132
UPDATE client SET  clientdebt = '16940', userid = '1' WHERE clientid = '17';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, 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 ('17','12890.00','4050','0','اضافة فاتورة مبيعات (معدله)','1132', '16940', '2026-10-20 19:18:50', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '4050', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-19 22:15:13','0','0','',''); -- id=1352
UPDATE client SET  inUse = 0 where clientid = 17;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6548;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02235', '1132', '102', '2235', '9.00', '450', '4050', '0', '', '0', '2026-10-20 19:18:50', '2235', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6548-9,','1','1','0','0','450','4050','0','','0','0.00','0','0','0','0'); -- id=4512
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 = 4512;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2235, '2026-10-20', 4050, 3780, 3780
                    , 3780, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, sellCostBuyPrice =sellCostBuyPrice+3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4050, 3780, 3780
                    , 3780, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, sellCostBuyPrice =sellCostBuyPrice+3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2026-10-20 19:18:50' WHERE storedetailid = '3626';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2235', '1', '9', '1', '1132', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '15', '6', '1', '2026-10-20 19:18:50','0','0'); -- id=15426
UPDATE dailyentry SET totalcreditor = '4050.00', totaldebtor = '4050.00', thedate = '2026-10-19', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-19 22:15:13', entryComment = 'اضافة فاتورة مبيعات رقم 1092', fromFlag = '1',related='0',isopeningentry='0',operationId='1092',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=1092' WHERE id = '3902';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '4050.00', '4050.00', '2026-10-20', '1', '0', '3902', '2026-10-20 19:18:50','تم عكس القيد رقم 3902 ','1','0','0','0','0',''); -- id=4018
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4018', '419', '4050.00', '','0'); -- id=4020
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '7059063', 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 ('4018', '143', '4050.00', '','0'); -- id=4124
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12765520', 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';
UPDATE dailyentry SET totalcreditor = '3780.00', totaldebtor = '3780.00', thedate = '2026-10-19', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-19 22:15:13', entryComment = 'اضافة فاتورة مبيعات رقم 1092 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='1092',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=1092' WHERE id = '3903';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '3780.00', '3780.00', '2026-10-20', '1', '0', '3903', '2026-10-20 19:18:50','تم عكس القيد رقم 3903 ','1','0','0','0','0',''); -- id=4019
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4019', '402', '3780.00', '','0'); -- id=4021
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11812527.61', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4019', '382', '3780.00', '','0'); -- id=4125
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24411977.09', 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 ( '4050', '4050', '2026-10-20', '1', '0', '0', '2026-10-20 19:18:50','اضافة فاتورة مبيعات رقم 1132','1','0',null,'0','1132','sellbillController.php?do=showDetail&sellbillid=1132'); -- id=4020
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4020', '515', '4050', '','0'); -- id=4126
UPDATE accountstree SET name = 'عنتر - العملاء', customName = 'عنتر - العملاء', customNameEn = 'عنتر - العملاء', nameEn = 'عنتر - العملاء', parent = '58', accountNature = '0', theValue = '8850', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2026-10-01 21:23:05' WHERE id = '515';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4020', '143', '4050', '','0'); -- id=4022
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12769570', 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 ( '3780', '3780', '2026-10-20', '1', '0', '0', '2026-10-20 19:18:50','اضافة فاتورة مبيعات رقم 1132 - صرف البضاعة من المخزن','1','0',null,'0','1132','sellbillController.php?do=showDetail&sellbillid=1132'); -- id=4021
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4021', '402', '3780', '','0'); -- id=4127
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11816307.61', 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 ('4021', '382', '3780', '','0'); -- id=4023
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24408197.09', 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='4020,0,4021' where sellbillid=1132;
 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-20', 4050, 3780, 3780
                    , 3780, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, sellCostBuyPrice =sellCostBuyPrice+3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (17, '2026-10-20', 4050, 3780, 3780
                    , 3780, 3780, 3780, 3780
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,3780, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4050, sellCostBuyPrice =sellCostBuyPrice+3780
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3780, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3780
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3780, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3780
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3780
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3780
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 4050, 3780, 3780
                    , 3780, 3780, 3780, 3780, 3780, 3780)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+4050, netSellCostBuyPrice = netSellCostBuyPrice+3780
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+3780
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+3780
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+3780
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+3780
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+3780
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+3780
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+3780;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 1092 and newid=1132 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:48:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:18:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:18:50', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=1132'); -- id=15879
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:48:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:18:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:18:58', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=15880
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:49:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:19:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:19:03', '1', 'editsellBill', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editsellBill&sellbillid=1091'); -- id=15881
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:49:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:19:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:19:19', '1', 'update', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=update'); -- id=15882
BEGIN;

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


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

UPDATE costcenterdetail SET del = 1 WHERE type in( 0) and  modelid = 1091;
UPDATE sellbill SET  sellbillsysdate = '2026-10-20 19:19:19', userid = '2',delbyuserid = '1', conditions = '1'  WHERE sellbillid = '1091';
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 6019;
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 395.60, meanbuyprice_withDiscount = 395.60
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 395.6
                where sellbilldetailid = 4328;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2029, '2026-10-20', 5160, 5160, 5160
                    , 5160, 4747.2, 4747.2, 4747.2
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 5160, 5160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5160, sellCostBuyPrice =sellCostBuyPrice-5160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5160, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4747.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4747.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4747.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5160
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 5160, 5160, 5160
                    , 5160, 4747.2, 4747.2, 4747.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5160, 5160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5160, sellCostBuyPrice =sellCostBuyPrice-5160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5160, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4747.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4747.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4747.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5160
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '54', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2029', '1', '12', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '42', '54', '1', '2026-10-19 22:05:39','0','0'); -- id=15427
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-27 where id = 6020;
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 414.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 4329;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2030, '2026-10-20', 12150, 12150, 12150
                    , 12150, 11178, 11178, 11178
                    , 0, 0, 0, 0
                    , 0, 0, 0,27,0, 12150, 12150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-12150, sellCostBuyPrice =sellCostBuyPrice-12150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-12150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-12150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-11178, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-11178
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-11178
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-12150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-12150
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-27
                        , netQuantityRet = netQuantityRet-0;
 INSERT 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-20', 12150, 12150, 12150
                    , 12150, 11178, 11178, 11178
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12150, 12150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-12150, sellCostBuyPrice =sellCostBuyPrice-12150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-12150, sellCostMeanBuyPrice = sellCostMeanBuyPrice-12150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-11178, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-11178
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-11178
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-12150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-12150
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '108', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3389';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2030', '1', '27', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '81', '108', '1', '2026-10-19 22:05:39','0','0'); -- id=15428
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 988;
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 = 4330;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1894, '2026-10-20', 8040, 7560, 7560
                    , 7560, 7560, 7560, 7560
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 7560, 7560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8040, sellCostBuyPrice =sellCostBuyPrice-7560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 8040, 7560, 7560
                    , 7560, 7560, 7560, 7560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7560, 7560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8040, sellCostBuyPrice =sellCostBuyPrice-7560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2911';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1894', '1', '12', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '32', '1', '2026-10-19 22:05:39','0','0'); -- id=15429
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-16 where id = 733;
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 4331;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1775, '2026-10-20', 8000, 8000, 8000
                    , 8000, 7200, 7200, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0,16,0, 8000, 8000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8000, sellCostBuyPrice =sellCostBuyPrice-8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7200
                            , 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-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 (1, '2026-10-20', 8000, 8000, 8000
                    , 8000, 7200, 7200, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8000, 8000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-8000, sellCostBuyPrice =sellCostBuyPrice-8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7200
                            , 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 = '80', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1775', '1', '16', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '64', '80', '1', '2026-10-19 22:05:39','0','0'); -- id=15430
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 5965;
UPDATE sellbilldetail SET  lastbuyprice = 328.00 , meanbuyprice = 328.00, lastbuyprice_withDiscount = 328.00, meanbuyprice_withDiscount = 328.00
        , lastbuyprice_withTax = 328, meanbuyprice_withTax = 328, lastbuyprice_withDiscountAndTax = 328
                where sellbilldetailid = 4332;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2014, '2026-10-20', 5220, 3936, 3936
                    , 3936, 3936, 3936, 3936
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 3936, 3936, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5220, sellCostBuyPrice =sellCostBuyPrice-3936
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3936, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3936
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3936, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3936
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3936
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3936
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3936
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 5220, 3936, 3936
                    , 3936, 3936, 3936, 3936
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3936, 3936, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5220, sellCostBuyPrice =sellCostBuyPrice-3936
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3936, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3936
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3936, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3936
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3936
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3936
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3936
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '572', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3372';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2014', '1', '12', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '560', '572', '1', '2026-10-19 22:05:39','0','0'); -- id=15431
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-20 where id = 688;
UPDATE sellbilldetail SET  lastbuyprice = 276.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 276.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 276, meanbuyprice_withTax = 276, lastbuyprice_withDiscountAndTax = 276
                where sellbilldetailid = 4333;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1467, '2026-10-20', 6800, 5520, 5520
                    , 5520, 5520, 5520, 5520
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 5520, 5520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6800, sellCostBuyPrice =sellCostBuyPrice-5520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5520, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5520
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 6800, 5520, 5520
                    , 5520, 5520, 5520, 5520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5520, 5520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6800, sellCostBuyPrice =sellCostBuyPrice-5520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5520, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5520
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '275', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '20', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '255', '275', '1', '2026-10-19 22:05:39','0','0'); -- id=15432
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 where id = 937;
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 524.40, meanbuyprice_withDiscount = 547.20
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 524.4
                where sellbilldetailid = 4334;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1867, '2026-10-20', 4560, 4560, 4560
                    , 4560, 4195.2, 4377.6, 4195.2
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 4560, 2280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4560, sellCostBuyPrice =sellCostBuyPrice-4560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4195.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4377.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4195.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4560
                            , 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-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-20', 4560, 4560, 4560
                    , 4560, 4195.2, 4377.6, 4195.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4560, 2280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4560, sellCostBuyPrice =sellCostBuyPrice-4560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4195.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4377.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4195.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4560
                            , 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 = '32', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2884';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1867', '1', '8', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '24', '32', '1', '2026-10-19 22:05:39','0','0'); -- id=15433
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 6244;
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 395.60, meanbuyprice_withDiscount = 395.60
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 395.6
                where sellbilldetailid = 4335;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2152, '2026-10-20', 2580, 2580, 2580
                    , 2580, 2373.6, 2373.6, 2373.6
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2580, 2580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2580, sellCostBuyPrice =sellCostBuyPrice-2580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2580, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2373.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2373.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2373.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2580
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 2580, 2580, 2580
                    , 2580, 2373.6, 2373.6, 2373.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2580, 2580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2580, sellCostBuyPrice =sellCostBuyPrice-2580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2580, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2373.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2373.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2373.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2580
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3511';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2152', '1', '6', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '18', '24', '1', '2026-10-19 22:05:39','0','0'); -- id=15434
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 where id = 565;
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 441.60, meanbuyprice_withDiscount = 455.19
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 309.99, lastbuyprice_withDiscountAndTax = 441.6
                where sellbilldetailid = 4336;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1702, '2026-10-20', 4320, 4320, 4320
                    , 4320, 3974.4, 4096.71, 3974.4
                    , 0, 0, 0, 0
                    , 0, 0, 0,9,0, 4320, 2789.91, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4320, sellCostBuyPrice =sellCostBuyPrice-4320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3974.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4096.71
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3974.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2789.91
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 4320, 4320, 4320
                    , 4320, 3974.4, 4096.71, 3974.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4320, 2789.91, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4320, sellCostBuyPrice =sellCostBuyPrice-4320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3974.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4096.71
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3974.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2789.91
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1702', '1', '9', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '39', '48', '1', '2026-10-19 22:05:39','0','0'); -- id=15435
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 77;
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 351.00, meanbuyprice_withDiscount = 370.97
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 190.32, lastbuyprice_withDiscountAndTax = 351
                where sellbilldetailid = 4337;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1386, '2026-10-20', 2340, 2340, 2340
                    , 2340, 2106, 2225.82, 2106
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2340, 1141.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2340, sellCostBuyPrice =sellCostBuyPrice-2340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2340, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2106, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2225.82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2106
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2340
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1141.92
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 2340, 2340, 2340
                    , 2340, 2106, 2225.82, 2106
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2340, 1141.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2340, sellCostBuyPrice =sellCostBuyPrice-2340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2340, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2106, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2225.82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2106
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2340
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1141.92
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1386';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1386', '1', '6', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '138', '144', '1', '2026-10-19 22:05:39','0','0'); -- id=15436
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-32 where id = 354;
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 4338;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1466, '2026-10-20', 11840, 9600, 9600
                    , 9600, 9600, 9600, 9600
                    , 0, 0, 0, 0
                    , 0, 0, 0,32,0, 9600, 9600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-11840, sellCostBuyPrice =sellCostBuyPrice-9600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-9600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-32
                        , netQuantityRet = netQuantityRet-0;
 INSERT 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-20', 11840, 9600, 9600
                    , 9600, 9600, 9600, 9600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9600, 9600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-11840, sellCostBuyPrice =sellCostBuyPrice-9600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9600, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-9600
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '384', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1491';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1466', '1', '32', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '352', '384', '1', '2026-10-19 22:05:39','0','0'); -- id=15437
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 675;
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 470.00
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 470
                where sellbilldetailid = 4339;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1761, '2026-10-20', 6120, 5640, 5640
                    , 5640, 5640, 5640, 5640
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 5640, 5640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6120, sellCostBuyPrice =sellCostBuyPrice-5640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5640, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5640
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 6120, 5640, 5640
                    , 5640, 5640, 5640, 5640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5640, 5640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6120, sellCostBuyPrice =sellCostBuyPrice-5640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5640, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5640
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2774';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1761', '1', '12', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '24', '1', '2026-10-19 22:05:39','0','0'); -- id=15438
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 680;
UPDATE sellbilldetail SET  lastbuyprice = 620.00 , meanbuyprice = 620.00, lastbuyprice_withDiscount = 620.00, meanbuyprice_withDiscount = 620.00
        , lastbuyprice_withTax = 620, meanbuyprice_withTax = 620, lastbuyprice_withDiscountAndTax = 620
                where sellbilldetailid = 4340;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1766, '2026-10-20', 7920, 7440, 7440
                    , 7440, 7440, 7440, 7440
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 7440, 7440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7920, sellCostBuyPrice =sellCostBuyPrice-7440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7440
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 7920, 7440, 7440
                    , 7440, 7440, 7440, 7440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7440, 7440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7920, sellCostBuyPrice =sellCostBuyPrice-7440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7440, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7440
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2779';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1766', '1', '12', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '8', '20', '1', '2026-10-19 22:05:39','0','0'); -- id=15439
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-1 where id = 6253;
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 324.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 324
                where sellbilldetailid = 4341;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2161, '2026-10-20', 360, 360, 360
                    , 360, 324, 324, 324
                    , 0, 0, 0, 0
                    , 0, 0, 0,1,0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-360, sellCostBuyPrice =sellCostBuyPrice-360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-324, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-324
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-324
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-360
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-1
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 360, 360, 360
                    , 360, 324, 324, 324
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-360, sellCostBuyPrice =sellCostBuyPrice-360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-360, sellCostMeanBuyPrice = sellCostMeanBuyPrice-360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-324, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-324
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-324
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-360
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '1', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3520';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2161', '1', '1', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '1', '1', '2026-10-19 22:05:39','0','0'); -- id=15440
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 where id = 793;
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 432.00, meanbuyprice_withDiscount = 432.00
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 432
                where sellbilldetailid = 4342;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1810, '2026-10-20', 4320, 4320, 4320
                    , 4320, 3888, 3888, 3888
                    , 0, 0, 0, 0
                    , 0, 0, 0,9,0, 4320, 4320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4320, sellCostBuyPrice =sellCostBuyPrice-4320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3888, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3888
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3888
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4320
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 4320, 4320, 4320
                    , 4320, 3888, 3888, 3888
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4320, 4320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4320, sellCostBuyPrice =sellCostBuyPrice-4320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4320, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-3888, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-3888
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-3888
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4320
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2824';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1810', '1', '9', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '27', '36', '1', '2026-10-19 22:05:39','0','0'); -- id=15441
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-28 where id = 6251;
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 324.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 324
                where sellbilldetailid = 4343;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2159, '2026-10-20', 10080, 10080, 10080
                    , 10080, 9072, 9072, 9072
                    , 0, 0, 0, 0
                    , 0, 0, 0,28,0, 10080, 10080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10080, sellCostBuyPrice =sellCostBuyPrice-10080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-10080, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9072, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9072
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9072
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-10080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-10080
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-28
                        , netQuantityRet = netQuantityRet-0;
 INSERT 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-20', 10080, 10080, 10080
                    , 10080, 9072, 9072, 9072
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10080, 10080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10080, sellCostBuyPrice =sellCostBuyPrice-10080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-10080, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9072, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9072
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9072
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-10080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-10080
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '76', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3518';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2159', '1', '28', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '48', '76', '1', '2026-10-19 22:05:39','0','0'); -- id=15442
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-18 where id = 6641;
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 306.00, meanbuyprice_withDiscount = 323.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 170, lastbuyprice_withDiscountAndTax = 306
                where sellbilldetailid = 4344;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2240, '2026-10-20', 6120, 6120, 6120
                    , 6120, 5508, 5814, 5508
                    , 0, 0, 0, 0
                    , 0, 0, 0,18,0, 6120, 3060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6120, sellCostBuyPrice =sellCostBuyPrice-6120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6120, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5508, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5814
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5508
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3060
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-18
                        , netQuantityRet = netQuantityRet-0;
 INSERT 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-20', 6120, 6120, 6120
                    , 6120, 5508, 5814, 5508
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6120, 3060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6120, sellCostBuyPrice =sellCostBuyPrice-6120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6120, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5508, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5814
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5508
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3060
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3631';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2240', '1', '18', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '18', '36', '1', '2026-10-19 22:05:39','0','0'); -- id=15443
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-16 where id = 1219;
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 4345;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1993, '2026-10-20', 6160, 5760, 5760
                    , 5760, 5760, 5760, 5760
                    , 0, 0, 0, 0
                    , 0, 0, 0,16,0, 5760, 5760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6160, sellCostBuyPrice =sellCostBuyPrice-5760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5760, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5760
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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 (1, '2026-10-20', 6160, 5760, 5760
                    , 5760, 5760, 5760, 5760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5760, 5760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-6160, sellCostBuyPrice =sellCostBuyPrice-5760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5760, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5760
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3010';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1993', '1', '16', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '16', '32', '1', '2026-10-19 22:05:39','0','0'); -- id=15444
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-4 where id = 1221;
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 = 4346;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1995, '2026-10-20', 1580, 1480, 1480
                    , 1480, 1480, 1480, 1480
                    , 0, 0, 0, 0
                    , 0, 0, 0,4,0, 1480, 1480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1580, sellCostBuyPrice =sellCostBuyPrice-1480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1480, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1480
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-4
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 1580, 1480, 1480
                    , 1480, 1480, 1480, 1480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1480, 1480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-1580, sellCostBuyPrice =sellCostBuyPrice-1480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1480, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1480
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3012';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1995', '1', '4', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '56', '60', '1', '2026-10-19 22:05:39','0','0'); -- id=15445
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-21 where id = 955;
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 342.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 324
                where sellbilldetailid = 4347;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1877, '2026-10-20', 7560, 7560, 7560
                    , 7560, 6804, 7182, 6804
                    , 0, 0, 0, 0
                    , 0, 0, 0,21,0, 7560, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7560, sellCostBuyPrice =sellCostBuyPrice-7560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6804, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6804
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3780
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 7560, 7560, 7560
                    , 7560, 6804, 7182, 6804
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7560, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7560, sellCostBuyPrice =sellCostBuyPrice-7560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7560, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6804, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6804
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3780
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '51', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2894';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1877', '1', '21', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '30', '51', '1', '2026-10-19 22:05:39','0','0'); -- id=15446
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 6368;
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 4348;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2194, '2026-10-20', 2100, 2100, 2100
                    , 2100, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2100, sellCostBuyPrice =sellCostBuyPrice-2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2100
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 2100, 2100, 2100
                    , 2100, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2100, sellCostBuyPrice =sellCostBuyPrice-2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2100
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3562';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2194', '1', '6', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '39', '45', '1', '2026-10-19 22:05:39','0','0'); -- id=15447
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 6516;
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 4349;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2206, '2026-10-20', 2100, 2100, 2100
                    , 2100, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2100, sellCostBuyPrice =sellCostBuyPrice-2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2100
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 2100, 2100, 2100
                    , 2100, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2100, sellCostBuyPrice =sellCostBuyPrice-2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2100
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '6', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2206', '1', '6', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '0', '6', '1', '2026-10-19 22:05:39','0','0'); -- id=15448
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-8 where id = 957;
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 351.00, meanbuyprice_withDiscount = 370.50
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 195, lastbuyprice_withDiscountAndTax = 351
                where sellbilldetailid = 4350;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1879, '2026-10-20', 3120, 3120, 3120
                    , 3120, 2808, 2964, 2808
                    , 0, 0, 0, 0
                    , 0, 0, 0,8,0, 3120, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3120, sellCostBuyPrice =sellCostBuyPrice-3120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3120, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2808, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2964
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2808
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 3120, 3120, 3120
                    , 3120, 2808, 2964, 2808
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3120, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-3120, sellCostBuyPrice =sellCostBuyPrice-3120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-3120, sellCostMeanBuyPrice = sellCostMeanBuyPrice-3120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2808, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2964
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2808
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-3120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1560
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2896';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1879', '1', '8', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '24', '32', '1', '2026-10-19 22:05:39','0','0'); -- id=15449
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-27 where id = 6087;
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 124.65, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 4351;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2055, '2026-10-20', 7290, 6750, 6750
                    , 6750, 6750, 6750, 6750
                    , 0, 0, 0, 0
                    , 0, 0, 0,27,0, 6750, 3365.55, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7290, sellCostBuyPrice =sellCostBuyPrice-6750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3365.55
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-27
                        , netQuantityRet = netQuantityRet-0;
 INSERT 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-20', 7290, 6750, 6750
                    , 6750, 6750, 6750, 6750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6750, 3365.55, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-7290, sellCostBuyPrice =sellCostBuyPrice-6750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-6750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-6750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-6750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-6750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-6750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-6750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-3365.55
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '128', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2055', '1', '27', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '101', '128', '1', '2026-10-19 22:05:39','0','0'); -- id=15450
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-30 where id = 1120;
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 = 4352;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1933, '2026-10-20', 12900, 12000, 12000
                    , 12000, 12000, 12000, 12000
                    , 0, 0, 0, 0
                    , 0, 0, 0,30,0, 12000, 12000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-12900, sellCostBuyPrice =sellCostBuyPrice-12000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-12000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-12000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-12000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-12000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-12000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-12000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-12000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-30
                        , netQuantityRet = netQuantityRet-0;
 INSERT 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-20', 12900, 12000, 12000
                    , 12000, 12000, 12000, 12000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12000, 12000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-12900, sellCostBuyPrice =sellCostBuyPrice-12000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-12000, sellCostMeanBuyPrice = sellCostMeanBuyPrice-12000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-12000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-12000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-12000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-12000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-12000
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '84', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1933', '1', '30', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '54', '84', '1', '2026-10-19 22:05:39','0','0'); -- id=15451
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-6 where id = 467;
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 4353;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1624, '2026-10-20', 2100, 1980, 1980
                    , 1980, 1980, 1980, 1980
                    , 0, 0, 0, 0
                    , 0, 0, 0,6,0, 1980, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2100, sellCostBuyPrice =sellCostBuyPrice-1980
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1980, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1980
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1980, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1980
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1980
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-990
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , 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-20', 2100, 1980, 1980
                    , 1980, 1980, 1980, 1980
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1980, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2100, sellCostBuyPrice =sellCostBuyPrice-1980
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1980, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1980
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1980, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1980
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1980
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-990
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '36', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1649';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1624', '1', '6', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '30', '36', '1', '2026-10-19 22:05:39','0','0'); -- id=15452
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-9 where id = 6125;
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 297.00, meanbuyprice_withDiscount = 297.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 297
                where sellbilldetailid = 4354;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2080, '2026-10-20', 2970, 2970, 2970
                    , 2970, 2673, 2673, 2673
                    , 0, 0, 0, 0
                    , 0, 0, 0,9,0, 2970, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2970, sellCostBuyPrice =sellCostBuyPrice-2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2673, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2673
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2673
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2970
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 2970, 2970, 2970
                    , 2970, 2673, 2673, 2673
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2970, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2970, sellCostBuyPrice =sellCostBuyPrice-2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice-2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-2673, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-2673
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-2673
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-2970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-2970
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3439';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2080', '1', '9', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '27', '36', '1', '2026-10-19 22:05:39','0','0'); -- id=15453
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-20 where id = 6476;
UPDATE sellbilldetail SET  lastbuyprice = 382.50 , meanbuyprice = 382.50, lastbuyprice_withDiscount = 382.50, meanbuyprice_withDiscount = 382.50
        , lastbuyprice_withTax = 382.5, meanbuyprice_withTax = 382.5, lastbuyprice_withDiscountAndTax = 382.5
                where sellbilldetailid = 4355;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2202, '2026-10-20', 9000, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0,20,0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 9000, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-9000, sellCostBuyPrice =sellCostBuyPrice-7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice-7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-7650
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '421', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3590';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2202', '1', '20', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '401', '421', '1', '2026-10-19 22:05:39','0','0'); -- id=15454
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-18 where id = 6537;
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 4356;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1841, '2026-10-20', 4500, 4230, 4230
                    , 4230, 4230, 4230, 4230
                    , 0, 0, 0, 0
                    , 0, 0, 0,18,0, 4230, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4500, sellCostBuyPrice =sellCostBuyPrice-4230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4230, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4140
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-18
                        , netQuantityRet = netQuantityRet-0;
 INSERT 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-20', 4500, 4230, 4230
                    , 4230, 4230, 4230, 4230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4230, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4500, sellCostBuyPrice =sellCostBuyPrice-4230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4230, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4140
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '292', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '18', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '274', '292', '1', '2026-10-19 22:05:39','0','0'); -- id=15455
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-25 where id = 507;
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 4357;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1680, '2026-10-20', 11125, 10750, 10750
                    , 10750, 10750, 10750, 10750
                    , 0, 0, 0, 0
                    , 0, 0, 0,25,0, 10750, 10750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-11125, sellCostBuyPrice =sellCostBuyPrice-10750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-10750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-10750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-10750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-10750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-10750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-25
                        , netQuantityRet = netQuantityRet-0;
 INSERT 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-20', 11125, 10750, 10750
                    , 10750, 10750, 10750, 10750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10750, 10750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-11125, sellCostBuyPrice =sellCostBuyPrice-10750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-10750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-10750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-10750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-10750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-10750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-10750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-10750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '42', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1680', '1', '25', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '17', '42', '1', '2026-10-19 22:05:39','0','0'); -- id=15456
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-12 where id = 508;
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 = 4358;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1681, '2026-10-20', 5220, 5040, 5040
                    , 5040, 5040, 5040, 5040
                    , 0, 0, 0, 0
                    , 0, 0, 0,12,0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5220, sellCostBuyPrice =sellCostBuyPrice-5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5040
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 5220, 5040, 5040
                    , 5040, 5040, 5040, 5040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-5220, sellCostBuyPrice =sellCostBuyPrice-5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice-5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-5040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-5040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-5040
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1681', '1', '12', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '12', '24', '1', '2026-10-19 22:05:39','0','0'); -- id=15457
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-10 where id = 39;
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 = 4359;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1347, '2026-10-20', 4950, 4750, 4750
                    , 4750, 4750, 4750, 4750
                    , 0, 0, 0, 0
                    , 0, 0, 0,10,0, 4750, 4750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4950, sellCostBuyPrice =sellCostBuyPrice-4750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 4950, 4750, 4750
                    , 4750, 4750, 4750, 4750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4750, 4750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-4950, sellCostBuyPrice =sellCostBuyPrice-4750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-4750, sellCostMeanBuyPrice = sellCostMeanBuyPrice-4750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-4750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-4750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-4750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-4750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-4750
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1347';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1347', '1', '10', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '20', '30', '1', '2026-10-19 22:05:39','0','0'); -- id=15458
UPDATE buypriceshistorybook set sellQuantity = sellQuantity-35 where id = 6711;
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 265.48, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 265.48
        , lastbuyprice_withTax = 265, meanbuyprice_withTax = 265.48, lastbuyprice_withDiscountAndTax = 265
                where sellbilldetailid = 4360;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1133, '2026-10-20', 10325, 9275, 9275
                    , 9291.8, 9275, 9291.8, 9275
                    , 0, 0, 0, 0
                    , 0, 0, 0,35,0, 9275, 9291.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10325, sellCostBuyPrice =sellCostBuyPrice-9275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9275, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9291.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9291.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-9291.8
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0
                        , netQuantity = netQuantity-35
                        , netQuantityRet = netQuantityRet-0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 10325, 9275, 9275
                    , 9291.8, 9275, 9291.8, 9275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9275, 9291.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-10325, sellCostBuyPrice =sellCostBuyPrice-9275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-9275, sellCostMeanBuyPrice = sellCostMeanBuyPrice-9291.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-9275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-9291.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-9275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-9275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-9291.8
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '830', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1133';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1133', '1', '35', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '795', '830', '1', '2026-10-19 22:05:39','0','0'); -- id=15459
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 = 4361;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1004, '2026-10-20', 2050, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0,5,0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2050, sellCostBuyPrice =sellCostBuyPrice-1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1950
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 2050, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-2050, sellCostBuyPrice =sellCostBuyPrice-1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice-1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-1950
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice-0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice-0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount-0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount-0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice-0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax-0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax-0;
UPDATE storedetail SET  productquantity = '21', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1004';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1004', '1', '5', '0', '1091', 'تعديل فاتورة مبيعات', 'sellbillController.php', '16', '21', '1', '2026-10-19 22:05:39','0','0'); -- id=15460
UPDATE client SET  clientdebt = '0', userid = '1' 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.00','1','تعديل فاتورة مبيعات','1091', '0', '2026-10-19 22:05:39', '1', 'sellbillController.php', 'تعديل فاتورة مبيعات', '200980', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-19 22:05:39','0','0','',''); -- id=1353
CALL saveInUse(2,@saveidis,@savecurrentvalueis,@currencyIdis,@treeIdis,@conversionFactoris);
UPDATE save SET  savecurrentvalue = '6858083.5',  userid = '1' 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 ('7059063.5','200980', '1', '2', 'تعديل فاتورة مبيعات', '1091', '6858083.5', '2026-10-20 19:19:19', '1',  'sellbillController.php','1','','0'); -- id=1396
 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-20', 200980, 189151, 189151
                    , 189167.8, 181942.4, 183223.73, 181942.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,189151, 171295.18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200980, sellCostBuyPrice =sellCostBuyPrice-189151
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-189151, sellCostMeanBuyPrice = sellCostMeanBuyPrice-189167.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-181942.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-183223.73
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-181942.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-189151
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-171295.18
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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-20', 200980, 189151, 189151
                    , 189167.8, 181942.4, 183223.73, 181942.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 189151, 171295.18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal-200980, sellCostBuyPrice =sellCostBuyPrice-189151
                        , sellCostLastBuyPrice = sellCostLastBuyPrice-189151, sellCostMeanBuyPrice = sellCostMeanBuyPrice-189167.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount-181942.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount-183223.73
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice-181942.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax-189151
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax-171295.18
                        , returnSellVal = returnSellVal-0, returnSellCostBuyPrice = returnSellCostBuyPrice-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, 200980, 189151, 189151
                    , 189167.8, 181942.4, 183223.73, 181942.4, 189151, 171295.18)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal-200980, netSellCostBuyPrice = netSellCostBuyPrice-189151
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice-189151
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice-189167.8
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount-181942.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount-183223.73
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice-181942.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax-189151
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax-171295.18;

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


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

COMMIT;
BEGIN;
CALL clientInUse(17,@clientdebt,@clientname,@treeIdis);
INSERT INTO sellbill (sellbilldate, sellbillserial, sellbillclientid, sellbilltotaldeptbefor, sellbilltotaldeptafter, sellbilldiscount, sellbilldiscounttype, sellbilltotalbill, sellbillaftertotalbill, sellbilltotalpayed, sellbillfinalbill, sellbillstoreid, sellbillsysdate,comment, userid, conditions, sellbillclientname, sellbillsaveid, sellbildirectpayment, billnameid, sellerid, tempclientName, sellQuantity,deletedsellid,controlname,tax, carnumber, cartype, carchase, carmotor,costcenterid,webApiId,visaAccountId,cashPayed,visaPayed,isBankAccountTransfer,obygyVisitId,extraDiscountPer,extraDiscountVal,taxOfDiscountPer,taxOfDiscountVal,taxBillNumber,collectionType,collectionDate,obgyBillType,billoperationid,datestarting,pricetype,currencyId,knownwayId,travelDriverId,travelBusId,travelPathId,travelTripId,travelTripTypeId,travelTripDateId,totalprodiscount,manage_ex,med_hallmark,pay_rec_no,pay_rec_val,decisionNo,decisionValue,sellToSupplier,supplierbuybillid,shipfrom,shipto,paymethodshipping,whatShippingCost,sellbilltypeclientid,tagids,obgyRefDoc,addressid,couponid,paymenttypeid,paymentdetails) VALUES ('2026-10-19 22:05:39', '06ad6675268a5d', '17', '16940.00', '217920', '0', '1', '200980', '200980', '0', '200980', '1', '2026-10-19 22:05:39', '', '1', '0', 'عنتر - العملاء', '2', '1', '3', '0', 'عنتر - العملاء', '498', '1091', 'sellbillController', '0','','','','','-1','0','0','0','0','0','0','0','0','0','0','0','0','0000-00-00','0','-1','2026-10-19','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','0',''); -- id=1133
UPDATE client SET  clientdebt = '217920', userid = '1' WHERE clientid = '17';
INSERT INTO clientdebtchange (clientid, clientdebtchangebefore, 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 ('17','16940.00','200980','0','اضافة فاتورة مبيعات (معدله)','1133', '217920', '2026-10-20 19:19:19', '1', 'sellbillController.php', 'اضافة فاتورة مبيعات (معدله)', '200980', '0', null, '0', null, null,'', '0','1','1','0','1','2026-10-19 22:05:39','0','0','',''); -- id=1354
UPDATE client SET  inUse = 0 where clientid = 17;
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 6019;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('395.6','02029', '1133', '166', '2029', '12.00', '430', '5160', '0', '', '0', '2026-10-20 19:19:19', '2029', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6019-12,','1','1','0','0','430','5160','0','','0','0.00','0','0','0','0'); -- id=4513
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 395.60, meanbuyprice_withDiscount = 395.60
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 395.6
                where sellbilldetailid = 4513;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2029, '2026-10-20', 5160, 5160, 5160
                    , 5160, 4747.2, 4747.2, 4747.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 5160, 5160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5160, sellCostBuyPrice =sellCostBuyPrice+5160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4747.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4747.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4747.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 5160, 5160, 5160
                    , 5160, 4747.2, 4747.2, 4747.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5160, 5160, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5160, sellCostBuyPrice =sellCostBuyPrice+5160
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5160, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5160
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4747.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4747.2
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4747.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5160
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5160
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '42', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3388';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2029', '1', '12', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '54', '42', '1', '2026-10-20 19:19:19','0','0'); -- id=15461
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+27 where id = 6020;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('414','02030', '1133', '166', '2030', '27.00', '450', '12150', '0', '', '0', '2026-10-20 19:19:19', '2030', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6020-27,','1','1','0','0','450','12150','0','','0','0.00','0','0','0','0'); -- id=4514
UPDATE sellbilldetail SET  lastbuyprice = 450.00 , meanbuyprice = 450.00, lastbuyprice_withDiscount = 414.00, meanbuyprice_withDiscount = 414.00
        , lastbuyprice_withTax = 450, meanbuyprice_withTax = 450, lastbuyprice_withDiscountAndTax = 414
                where sellbilldetailid = 4514;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2030, '2026-10-20', 12150, 12150, 12150
                    , 12150, 11178, 11178, 11178
                    , 0, 0, 0, 0
                    , 0, 0, 0, 27, 0, 12150, 12150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12150, sellCostBuyPrice =sellCostBuyPrice+12150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11178, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11178
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11178
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+27
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 12150, 12150, 12150
                    , 12150, 11178, 11178, 11178
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12150, 12150, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12150, sellCostBuyPrice =sellCostBuyPrice+12150
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12150, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12150
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+11178, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+11178
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+11178
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12150
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12150
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '81', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3389';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2030', '1', '27', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '108', '81', '1', '2026-10-20 19:19:19','0','0'); -- id=15462
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 988;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01894', '1133', '136', '1894', '12.00', '670', '8040', '0', '', '0', '2026-10-20 19:19:19', '1894', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','988-12,','1','1','0','0','670','8040','0','','0','0.00','0','0','0','0'); -- id=4515
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 = 4515;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1894, '2026-10-20', 8040, 7560, 7560
                    , 7560, 7560, 7560, 7560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 7560, 7560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8040, sellCostBuyPrice =sellCostBuyPrice+7560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 8040, 7560, 7560
                    , 7560, 7560, 7560, 7560
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7560, 7560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8040, sellCostBuyPrice =sellCostBuyPrice+7560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7560, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7560
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7560
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2911';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1894', '1', '12', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '32', '20', '1', '2026-10-20 19:19:19','0','0'); -- id=15463
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 where id = 733;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('450','01775', '1133', '99', '1775', '16.00', '500', '8000', '0', '', '0', '2026-10-20 19:19:19', '1775', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','733-16,','1','1','0','0','500','8000','0','','0','0.00','0','0','0','0'); -- id=4516
UPDATE sellbilldetail SET  lastbuyprice = 500.00 , meanbuyprice = 500.00, lastbuyprice_withDiscount = 450.00, meanbuyprice_withDiscount = 450.00
        , lastbuyprice_withTax = 500, meanbuyprice_withTax = 500, lastbuyprice_withDiscountAndTax = 450
                where sellbilldetailid = 4516;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1775, '2026-10-20', 8000, 8000, 8000
                    , 8000, 7200, 7200, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 8000, 8000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8000, sellCostBuyPrice =sellCostBuyPrice+8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7200
                            , 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+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 (1, '2026-10-20', 8000, 8000, 8000
                    , 8000, 7200, 7200, 7200
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8000, 8000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+8000, sellCostBuyPrice =sellCostBuyPrice+8000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+8000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+8000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7200, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7200
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7200
                            , 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 = '64', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2788';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1775', '1', '16', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '80', '64', '1', '2026-10-20 19:19:19','0','0'); -- id=15464
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 5965;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('328','02014', '1133', '104', '2014', '12.00', '435', '5220', '0', '', '0', '2026-10-20 19:19:19', '2014', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','5965-12,','1','1','0','0','435','5220','0','','0','0.00','0','0','0','0'); -- id=4517
UPDATE sellbilldetail SET  lastbuyprice = 328.00 , meanbuyprice = 328.00, lastbuyprice_withDiscount = 328.00, meanbuyprice_withDiscount = 328.00
        , lastbuyprice_withTax = 328, meanbuyprice_withTax = 328, lastbuyprice_withDiscountAndTax = 328
                where sellbilldetailid = 4517;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2014, '2026-10-20', 5220, 3936, 3936
                    , 3936, 3936, 3936, 3936
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 3936, 3936, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5220, sellCostBuyPrice =sellCostBuyPrice+3936
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3936, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3936
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3936, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3936
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3936
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3936
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3936
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 5220, 3936, 3936
                    , 3936, 3936, 3936, 3936
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3936, 3936, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5220, sellCostBuyPrice =sellCostBuyPrice+3936
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3936, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3936
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3936, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3936
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3936
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3936
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3936
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '560', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3372';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2014', '1', '12', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '572', '560', '1', '2026-10-20 19:19:19','0','0'); -- id=15465
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 688;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('276','01467', '1133', '104', '1467', '20.00', '340', '6800', '0', '', '0', '2026-10-20 19:19:19', '1467', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','688-20,','1','1','0','0','340','6800','0','','0','0.00','0','0','0','0'); -- id=4518
UPDATE sellbilldetail SET  lastbuyprice = 276.00 , meanbuyprice = 276.00, lastbuyprice_withDiscount = 276.00, meanbuyprice_withDiscount = 276.00
        , lastbuyprice_withTax = 276, meanbuyprice_withTax = 276, lastbuyprice_withDiscountAndTax = 276
                where sellbilldetailid = 4518;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1467, '2026-10-20', 6800, 5520, 5520
                    , 5520, 5520, 5520, 5520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 5520, 5520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+5520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 6800, 5520, 5520
                    , 5520, 5520, 5520, 5520
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5520, 5520, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6800, sellCostBuyPrice =sellCostBuyPrice+5520
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5520, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5520
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5520, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5520
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5520
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5520
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5520
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '255', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1492';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1467', '1', '20', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '275', '255', '1', '2026-10-20 19:19:19','0','0'); -- id=15466
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 937;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('524.4','01867', '1133', '146', '1867', '8.00', '570', '4560', '0', '', '0', '2026-10-20 19:19:19', '1867', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','937-8,','1','1','0','0','570','4560','0','','0','0.00','0','0','0','0'); -- id=4519
UPDATE sellbilldetail SET  lastbuyprice = 570.00 , meanbuyprice = 570.00, lastbuyprice_withDiscount = 524.40, meanbuyprice_withDiscount = 547.20
        , lastbuyprice_withTax = 570, meanbuyprice_withTax = 285, lastbuyprice_withDiscountAndTax = 524.4
                where sellbilldetailid = 4519;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1867, '2026-10-20', 4560, 4560, 4560
                    , 4560, 4195.2, 4377.6, 4195.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 4560, 2280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4560, sellCostBuyPrice =sellCostBuyPrice+4560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4195.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4377.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4195.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4560
                            , 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+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-20', 4560, 4560, 4560
                    , 4560, 4195.2, 4377.6, 4195.2
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4560, 2280, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4560, sellCostBuyPrice =sellCostBuyPrice+4560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4195.2, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4377.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4195.2
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4560
                            , 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 = '24', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2884';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1867', '1', '8', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '32', '24', '1', '2026-10-20 19:19:19','0','0'); -- id=15467
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6244;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('395.6','02152', '1133', '188', '2152', '6.00', '430', '2580', '0', '', '0', '2026-10-20 19:19:19', '2152', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6244-6,','1','1','0','0','430','2580','0','','0','0.00','0','0','0','0'); -- id=4520
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 395.60, meanbuyprice_withDiscount = 395.60
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 395.6
                where sellbilldetailid = 4520;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2152, '2026-10-20', 2580, 2580, 2580
                    , 2580, 2373.6, 2373.6, 2373.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2580, 2580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2373.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2373.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2373.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2580
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2580, 2580, 2580
                    , 2580, 2373.6, 2373.6, 2373.6
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2580, 2580, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2580, sellCostBuyPrice =sellCostBuyPrice+2580
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2580, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2580
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2373.6, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2373.6
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2373.6
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2580
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2580
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3511';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2152', '1', '6', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '24', '18', '1', '2026-10-20 19:19:19','0','0'); -- id=15468
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 565;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('441.6','01702', '1133', '128', '1702', '9.00', '480', '4320', '0', '', '0', '2026-10-20 19:19:19', '1702', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','565-9,','1','1','0','0','480','4320','0','','0','0.00','0','0','0','0'); -- id=4521
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 441.60, meanbuyprice_withDiscount = 455.19
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 309.99, lastbuyprice_withDiscountAndTax = 441.6
                where sellbilldetailid = 4521;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1702, '2026-10-20', 4320, 4320, 4320
                    , 4320, 3974.4, 4096.71, 3974.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4320, 2789.91, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+4320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3974.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4096.71
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3974.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2789.91
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4320, 4320, 4320
                    , 4320, 3974.4, 4096.71, 3974.4
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4320, 2789.91, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+4320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3974.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4096.71
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3974.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2789.91
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '39', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2714';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1702', '1', '9', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '48', '39', '1', '2026-10-20 19:19:19','0','0'); -- id=15469
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 77;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('351','01386', '1133', '95', '1386', '6.00', '390', '2340', '0', '', '0', '2026-10-20 19:19:19', '1386', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','77-6,','1','1','0','0','390','2340','0','','0','0.00','0','0','0','0'); -- id=4522
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 351.00, meanbuyprice_withDiscount = 370.97
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 190.32, lastbuyprice_withDiscountAndTax = 351
                where sellbilldetailid = 4522;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1386, '2026-10-20', 2340, 2340, 2340
                    , 2340, 2106, 2225.82, 2106
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2340, 1141.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2340, sellCostBuyPrice =sellCostBuyPrice+2340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2106, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2225.82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2106
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2340
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1141.92
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2340, 2340, 2340
                    , 2340, 2106, 2225.82, 2106
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2340, 1141.92, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2340, sellCostBuyPrice =sellCostBuyPrice+2340
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2340, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2340
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2106, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2225.82
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2106
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2340
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1141.92
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '138', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1386';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1386', '1', '6', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '144', '138', '1', '2026-10-20 19:19:19','0','0'); -- id=15470
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+32 where id = 354;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('300','01466', '1133', '104', '1466', '32.00', '370', '11840', '0', '', '0', '2026-10-20 19:19:19', '1466', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','354-32,','1','1','0','0','370','11840','0','','0','0.00','0','0','0','0'); -- id=4523
UPDATE sellbilldetail SET  lastbuyprice = 300.00 , meanbuyprice = 300.00, lastbuyprice_withDiscount = 300.00, meanbuyprice_withDiscount = 300.00
        , lastbuyprice_withTax = 300, meanbuyprice_withTax = 300, lastbuyprice_withDiscountAndTax = 300
                where sellbilldetailid = 4523;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1466, '2026-10-20', 11840, 9600, 9600
                    , 9600, 9600, 9600, 9600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 32, 0, 9600, 9600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11840, sellCostBuyPrice =sellCostBuyPrice+9600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+32
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 11840, 9600, 9600
                    , 9600, 9600, 9600, 9600
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9600, 9600, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11840, sellCostBuyPrice =sellCostBuyPrice+9600
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9600, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9600
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9600, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9600
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9600
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9600
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9600
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '352', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1491';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1466', '1', '32', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '384', '352', '1', '2026-10-20 19:19:19','0','0'); -- id=15471
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 675;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('470','01761', '1133', '136', '1761', '12.00', '510', '6120', '0', '', '0', '2026-10-20 19:19:19', '1761', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','675-12,','1','1','0','0','510','6120','0','','0','0.00','0','0','0','0'); -- id=4524
UPDATE sellbilldetail SET  lastbuyprice = 470.00 , meanbuyprice = 470.00, lastbuyprice_withDiscount = 470.00, meanbuyprice_withDiscount = 470.00
        , lastbuyprice_withTax = 470, meanbuyprice_withTax = 470, lastbuyprice_withDiscountAndTax = 470
                where sellbilldetailid = 4524;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1761, '2026-10-20', 6120, 5640, 5640
                    , 5640, 5640, 5640, 5640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 5640, 5640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6120, sellCostBuyPrice =sellCostBuyPrice+5640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 6120, 5640, 5640
                    , 5640, 5640, 5640, 5640
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5640, 5640, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6120, sellCostBuyPrice =sellCostBuyPrice+5640
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5640, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5640
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5640, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5640
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5640
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5640
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5640
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2774';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1761', '1', '12', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '24', '12', '1', '2026-10-20 19:19:19','0','0'); -- id=15472
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 680;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('620','01766', '1133', '137', '1766', '12.00', '660', '7920', '0', '', '0', '2026-10-20 19:19:19', '1766', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','680-12,','1','1','0','0','660','7920','0','','0','0.00','0','0','0','0'); -- id=4525
UPDATE sellbilldetail SET  lastbuyprice = 620.00 , meanbuyprice = 620.00, lastbuyprice_withDiscount = 620.00, meanbuyprice_withDiscount = 620.00
        , lastbuyprice_withTax = 620, meanbuyprice_withTax = 620, lastbuyprice_withDiscountAndTax = 620
                where sellbilldetailid = 4525;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1766, '2026-10-20', 7920, 7440, 7440
                    , 7440, 7440, 7440, 7440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 7440, 7440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7920, sellCostBuyPrice =sellCostBuyPrice+7440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 7920, 7440, 7440
                    , 7440, 7440, 7440, 7440
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7440, 7440, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7920, sellCostBuyPrice =sellCostBuyPrice+7440
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7440, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7440
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7440, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7440
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7440
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7440
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7440
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '8', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2779';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1766', '1', '12', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '20', '8', '1', '2026-10-20 19:19:19','0','0'); -- id=15473
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+1 where id = 6253;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('324','02161', '1133', '99', '2161', '1.00', '360', '360', '0', '', '0', '2026-10-20 19:19:19', '2161', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6253-1,','1','1','0','0','360','360','0','','0','0.00','0','0','0','0'); -- id=4526
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 324.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 324
                where sellbilldetailid = 4526;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2161, '2026-10-20', 360, 360, 360
                    , 360, 324, 324, 324
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+324, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+324
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+324
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+1
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 360, 360, 360
                    , 360, 324, 324, 324
                    , 0, 0, 0, 0
                    , 0, 0, 0, 360, 360, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+360, sellCostBuyPrice =sellCostBuyPrice+360
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+360, sellCostMeanBuyPrice = sellCostMeanBuyPrice+360
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+324, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+324
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+324
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+360
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+360
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '0', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3520';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2161', '1', '1', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '1', '0', '1', '2026-10-20 19:19:19','0','0'); -- id=15474
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 793;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('432','01810', '1133', '122', '1810', '9.00', '480', '4320', '0', '', '0', '2026-10-20 19:19:19', '1810', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','793-9,','1','1','0','0','480','4320','0','','0','0.00','0','0','0','0'); -- id=4527
UPDATE sellbilldetail SET  lastbuyprice = 480.00 , meanbuyprice = 480.00, lastbuyprice_withDiscount = 432.00, meanbuyprice_withDiscount = 432.00
        , lastbuyprice_withTax = 480, meanbuyprice_withTax = 480, lastbuyprice_withDiscountAndTax = 432
                where sellbilldetailid = 4527;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1810, '2026-10-20', 4320, 4320, 4320
                    , 4320, 3888, 3888, 3888
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 4320, 4320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+4320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3888, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3888
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3888
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4320, 4320, 4320
                    , 4320, 3888, 3888, 3888
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4320, 4320, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4320, sellCostBuyPrice =sellCostBuyPrice+4320
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4320, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4320
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+3888, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+3888
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+3888
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4320
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4320
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2824';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1810', '1', '9', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '36', '27', '1', '2026-10-20 19:19:19','0','0'); -- id=15475
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+28 where id = 6251;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('324','i0002159', '1133', '99', '2159', '28.00', '360', '10080', '0', '', '0', '2026-10-20 19:19:19', '2159', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6251-28,','1','1','0','0','360','10080','0','','0','0.00','0','0','0','0'); -- id=4528
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 324.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 324
                where sellbilldetailid = 4528;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2159, '2026-10-20', 10080, 10080, 10080
                    , 10080, 9072, 9072, 9072
                    , 0, 0, 0, 0
                    , 0, 0, 0, 28, 0, 10080, 10080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10080, sellCostBuyPrice =sellCostBuyPrice+10080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9072, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9072
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9072
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+28
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 10080, 10080, 10080
                    , 10080, 9072, 9072, 9072
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10080, 10080, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10080, sellCostBuyPrice =sellCostBuyPrice+10080
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10080, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10080
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9072, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9072
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9072
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10080
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10080
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '48', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3518';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2159', '1', '28', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '76', '48', '1', '2026-10-20 19:19:19','0','0'); -- id=15476
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 6641;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('306','02240', '1133', '76', '2240', '18.00', '340', '6120', '0', '', '0', '2026-10-20 19:19:19', '2240', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6641-18,','1','1','0','0','340','6120','0','','0','0.00','0','0','0','0'); -- id=4529
UPDATE sellbilldetail SET  lastbuyprice = 340.00 , meanbuyprice = 340.00, lastbuyprice_withDiscount = 306.00, meanbuyprice_withDiscount = 323.00
        , lastbuyprice_withTax = 340, meanbuyprice_withTax = 170, lastbuyprice_withDiscountAndTax = 306
                where sellbilldetailid = 4529;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2240, '2026-10-20', 6120, 6120, 6120
                    , 6120, 5508, 5814, 5508
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 6120, 3060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6120, sellCostBuyPrice =sellCostBuyPrice+6120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5508, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5814
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5508
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3060
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+18
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 6120, 6120, 6120
                    , 6120, 5508, 5814, 5508
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6120, 3060, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6120, sellCostBuyPrice =sellCostBuyPrice+6120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5508, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5814
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5508
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3060
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '18', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3631';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2240', '1', '18', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '36', '18', '1', '2026-10-20 19:19:19','0','0'); -- id=15477
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+16 where id = 1219;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('360','01993', '1133', '78', '1993', '16.00', '385', '6160', '0', '', '0', '2026-10-20 19:19:19', '1993', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1219-16,','1','1','0','0','385','6160','0','','0','0.00','0','0','0','0'); -- id=4530
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 360.00, meanbuyprice_withDiscount = 360.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 360, lastbuyprice_withDiscountAndTax = 360
                where sellbilldetailid = 4530;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1993, '2026-10-20', 6160, 5760, 5760
                    , 5760, 5760, 5760, 5760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 16, 0, 5760, 5760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6160, sellCostBuyPrice =sellCostBuyPrice+5760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5760
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (1, '2026-10-20', 6160, 5760, 5760
                    , 5760, 5760, 5760, 5760
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5760, 5760, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+6160, sellCostBuyPrice =sellCostBuyPrice+5760
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5760, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5760
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5760, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5760
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5760
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5760
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5760
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3010';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1993', '1', '16', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '32', '16', '1', '2026-10-20 19:19:19','0','0'); -- id=15478
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+4 where id = 1221;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01995', '1133', '78', '1995', '4.00', '395', '1580', '0', '', '0', '2026-10-20 19:19:19', '1995', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','1221-4,','1','1','0','0','395','1580','0','','0','0.00','0','0','0','0'); -- id=4531
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 = 4531;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1995, '2026-10-20', 1580, 1480, 1480
                    , 1480, 1480, 1480, 1480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4, 0, 1480, 1480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1580, sellCostBuyPrice =sellCostBuyPrice+1480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+4
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 1580, 1480, 1480
                    , 1480, 1480, 1480, 1480
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1480, 1480, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+1580, sellCostBuyPrice =sellCostBuyPrice+1480
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1480, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1480
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1480, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1480
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1480
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1480
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1480
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '56', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3012';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1995', '1', '4', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '60', '56', '1', '2026-10-20 19:19:19','0','0'); -- id=15479
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+21 where id = 955;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('324','01877', '1133', '75', '1877', '21.00', '360', '7560', '0', '', '0', '2026-10-20 19:19:19', '1877', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','955-21,','1','1','0','0','360','7560','0','','0','0.00','0','0','0','0'); -- id=4532
UPDATE sellbilldetail SET  lastbuyprice = 360.00 , meanbuyprice = 360.00, lastbuyprice_withDiscount = 324.00, meanbuyprice_withDiscount = 342.00
        , lastbuyprice_withTax = 360, meanbuyprice_withTax = 180, lastbuyprice_withDiscountAndTax = 324
                where sellbilldetailid = 4532;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1877, '2026-10-20', 7560, 7560, 7560
                    , 7560, 6804, 7182, 6804
                    , 0, 0, 0, 0
                    , 0, 0, 0, 21, 0, 7560, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7560, sellCostBuyPrice =sellCostBuyPrice+7560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6804, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6804
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 7560, 7560, 7560
                    , 7560, 6804, 7182, 6804
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7560, 3780, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7560, sellCostBuyPrice =sellCostBuyPrice+7560
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7560, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7560
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6804, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7182
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6804
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7560
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3780
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2894';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1877', '1', '21', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '51', '30', '1', '2026-10-20 19:19:19','0','0'); -- id=15480
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6368;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02194', '1133', '72', '2194', '6.00', '350', '2100', '0', '', '0', '2026-10-20 19:19:19', '2194', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6368-6,','1','1','0','0','350','2100','0','','0','0.00','0','0','0','0'); -- id=4533
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 4533;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2194, '2026-10-20', 2100, 2100, 2100
                    , 2100, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2100, 2100, 2100
                    , 2100, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '39', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3562';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2194', '1', '6', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '45', '39', '1', '2026-10-20 19:19:19','0','0'); -- id=15481
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 6516;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02206', '1133', '48', '2206', '6.00', '350', '2100', '0', '', '0', '2026-10-20 19:19:19', '2206', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6516-6,','1','1','0','0','350','2100','0','','0','0.00','0','0','0','0'); -- id=4534
UPDATE sellbilldetail SET  lastbuyprice = 350.00 , meanbuyprice = 350.00, lastbuyprice_withDiscount = 315.00, meanbuyprice_withDiscount = 315.00
        , lastbuyprice_withTax = 350, meanbuyprice_withTax = 350, lastbuyprice_withDiscountAndTax = 315
                where sellbilldetailid = 4534;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2206, '2026-10-20', 2100, 2100, 2100
                    , 2100, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2100, 2100, 2100
                    , 2100, 1890, 1890, 1890
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2100, 2100, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+2100
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2100, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2100
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1890, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1890
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1890
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2100
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2100
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3597';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2206', '1', '6', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '6', '0', '1', '2026-10-20 19:19:19','0','0'); -- id=15482
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+8 where id = 957;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('351','01879', '1133', '75', '1879', '8.00', '390', '3120', '0', '', '0', '2026-10-20 19:19:19', '1879', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','957-8,','1','1','0','0','390','3120','0','','0','0.00','0','0','0','0'); -- id=4535
UPDATE sellbilldetail SET  lastbuyprice = 390.00 , meanbuyprice = 390.00, lastbuyprice_withDiscount = 351.00, meanbuyprice_withDiscount = 370.50
        , lastbuyprice_withTax = 390, meanbuyprice_withTax = 195, lastbuyprice_withDiscountAndTax = 351
                where sellbilldetailid = 4535;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1879, '2026-10-20', 3120, 3120, 3120
                    , 3120, 2808, 2964, 2808
                    , 0, 0, 0, 0
                    , 0, 0, 0, 8, 0, 3120, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3120, sellCostBuyPrice =sellCostBuyPrice+3120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2808, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2964
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2808
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 3120, 3120, 3120
                    , 3120, 2808, 2964, 2808
                    , 0, 0, 0, 0
                    , 0, 0, 0, 3120, 1560, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+3120, sellCostBuyPrice =sellCostBuyPrice+3120
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+3120, sellCostMeanBuyPrice = sellCostMeanBuyPrice+3120
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2808, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2964
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2808
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+3120
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1560
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2896';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1879', '1', '8', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '32', '24', '1', '2026-10-20 19:19:19','0','0'); -- id=15483
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+27 where id = 6087;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','02055', '1133', '169', '2055', '27.00', '270', '7290', '0', '', '0', '2026-10-20 19:19:19', '2055', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6087-27,','1','1','0','0','270','7290','0','','0','0.00','0','0','0','0'); -- id=4536
UPDATE sellbilldetail SET  lastbuyprice = 250.00 , meanbuyprice = 250.00, lastbuyprice_withDiscount = 250.00, meanbuyprice_withDiscount = 250.00
        , lastbuyprice_withTax = 250, meanbuyprice_withTax = 124.65, lastbuyprice_withDiscountAndTax = 250
                where sellbilldetailid = 4536;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2055, '2026-10-20', 7290, 6750, 6750
                    , 6750, 6750, 6750, 6750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 27, 0, 6750, 3365.55, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7290, sellCostBuyPrice =sellCostBuyPrice+6750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3365.55
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+27
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 7290, 6750, 6750
                    , 6750, 6750, 6750, 6750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6750, 3365.55, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+7290, sellCostBuyPrice =sellCostBuyPrice+6750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+6750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+6750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+6750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+6750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+6750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+6750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+3365.55
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '101', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3414';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2055', '1', '27', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '128', '101', '1', '2026-10-20 19:19:19','0','0'); -- id=15484
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+30 where id = 1120;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01933', '1133', '102', '1933', '30.00', '430', '12900', '0', '', '0', '2026-10-20 19:19:19', '1933', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','1120-30,','1','1','0','0','430','12900','0','','0','0.00','0','0','0','0'); -- id=4537
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 = 4537;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1933, '2026-10-20', 12900, 12000, 12000
                    , 12000, 12000, 12000, 12000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 30, 0, 12000, 12000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12900, sellCostBuyPrice =sellCostBuyPrice+12000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+30
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 12900, 12000, 12000
                    , 12000, 12000, 12000, 12000
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12000, 12000, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+12900, sellCostBuyPrice =sellCostBuyPrice+12000
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+12000, sellCostMeanBuyPrice = sellCostMeanBuyPrice+12000
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+12000, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+12000
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+12000
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+12000
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+12000
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '54', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2950';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1933', '1', '30', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '84', '54', '1', '2026-10-20 19:19:19','0','0'); -- id=15485
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+6 where id = 467;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01624', '1133', '32', '1624', '6.00', '350', '2100', '0', '', '0', '2026-10-20 19:19:19', '1624', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','467-6,','1','1','0','0','350','2100','0','','0','0.00','0','0','0','0'); -- id=4538
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 330.00, meanbuyprice_withDiscount = 330.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 165, lastbuyprice_withDiscountAndTax = 330
                where sellbilldetailid = 4538;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1624, '2026-10-20', 2100, 1980, 1980
                    , 1980, 1980, 1980, 1980
                    , 0, 0, 0, 0
                    , 0, 0, 0, 6, 0, 1980, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+1980
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1980, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1980
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1980, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1980
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1980
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+990
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , 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-20', 2100, 1980, 1980
                    , 1980, 1980, 1980, 1980
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1980, 990, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2100, sellCostBuyPrice =sellCostBuyPrice+1980
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1980, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1980
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1980, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1980
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1980
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1980
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+990
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '30', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1649';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1624', '1', '6', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '36', '30', '1', '2026-10-20 19:19:19','0','0'); -- id=15486
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+9 where id = 6125;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('297','02080', '1133', '43', '2080', '9.00', '330', '2970', '0', '', '0', '2026-10-20 19:19:19', '2080', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6125-9,','1','1','0','0','330','2970','0','','0','0.00','0','0','0','0'); -- id=4539
UPDATE sellbilldetail SET  lastbuyprice = 330.00 , meanbuyprice = 330.00, lastbuyprice_withDiscount = 297.00, meanbuyprice_withDiscount = 297.00
        , lastbuyprice_withTax = 330, meanbuyprice_withTax = 330, lastbuyprice_withDiscountAndTax = 297
                where sellbilldetailid = 4539;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2080, '2026-10-20', 2970, 2970, 2970
                    , 2970, 2673, 2673, 2673
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9, 0, 2970, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2970, sellCostBuyPrice =sellCostBuyPrice+2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2673, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2673
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2673
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2970
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2970, 2970, 2970
                    , 2970, 2673, 2673, 2673
                    , 0, 0, 0, 0
                    , 0, 0, 0, 2970, 2970, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2970, sellCostBuyPrice =sellCostBuyPrice+2970
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+2970, sellCostMeanBuyPrice = sellCostMeanBuyPrice+2970
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+2673, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+2673
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+2673
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+2970
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+2970
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '27', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3439';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2080', '1', '9', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '36', '27', '1', '2026-10-20 19:19:19','0','0'); -- id=15487
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+20 where id = 6476;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('382.5','02202', '1133', '104', '2202', '20.00', '450', '9000', '0', '', '0', '2026-10-20 19:19:19', '2202', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6476-20,','1','1','0','0','450','9000','0','','0','0.00','0','0','0','0'); -- id=4540
UPDATE sellbilldetail SET  lastbuyprice = 382.50 , meanbuyprice = 382.50, lastbuyprice_withDiscount = 382.50, meanbuyprice_withDiscount = 382.50
        , lastbuyprice_withTax = 382.5, meanbuyprice_withTax = 382.5, lastbuyprice_withDiscountAndTax = 382.5
                where sellbilldetailid = 4540;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (2202, '2026-10-20', 9000, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 20, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 9000, 7650, 7650
                    , 7650, 7650, 7650, 7650
                    , 0, 0, 0, 0
                    , 0, 0, 0, 7650, 7650, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+9000, sellCostBuyPrice =sellCostBuyPrice+7650
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+7650, sellCostMeanBuyPrice = sellCostMeanBuyPrice+7650
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+7650, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+7650
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+7650
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+7650
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+7650
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '401', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '3590';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('2202', '1', '20', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '421', '401', '1', '2026-10-20 19:19:19','0','0'); -- id=15488
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+18 where id = 6537;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('235','01841', '1133', '142', '1841', '18.00', '250', '4500', '0', '', '0', '2026-10-20 19:19:19', '1841', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','6537-18,','1','1','0','0','250','4500','0','','0','0.00','0','0','0','0'); -- id=4541
UPDATE sellbilldetail SET  lastbuyprice = 235.00 , meanbuyprice = 235.00, lastbuyprice_withDiscount = 235.00, meanbuyprice_withDiscount = 235.00
        , lastbuyprice_withTax = 235, meanbuyprice_withTax = 230, lastbuyprice_withDiscountAndTax = 235
                where sellbilldetailid = 4541;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1841, '2026-10-20', 4500, 4230, 4230
                    , 4230, 4230, 4230, 4230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 18, 0, 4230, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4500, sellCostBuyPrice =sellCostBuyPrice+4230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+18
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 4500, 4230, 4230
                    , 4230, 4230, 4230, 4230
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4230, 4140, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4500, sellCostBuyPrice =sellCostBuyPrice+4230
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4230, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4230
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4230, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4230
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4230
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4230
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4140
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '274', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2856';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1841', '1', '18', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '292', '274', '1', '2026-10-20 19:19:19','0','0'); -- id=15489
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+25 where id = 507;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('430','01680', '1133', '2', '1680', '25.00', '445', '11125', '0', '', '0', '2026-10-20 19:19:19', '1680', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','507-25,','1','1','0','0','445','11125','0','','0','0.00','0','0','0','0'); -- id=4542
UPDATE sellbilldetail SET  lastbuyprice = 430.00 , meanbuyprice = 430.00, lastbuyprice_withDiscount = 430.00, meanbuyprice_withDiscount = 430.00
        , lastbuyprice_withTax = 430, meanbuyprice_withTax = 430, lastbuyprice_withDiscountAndTax = 430
                where sellbilldetailid = 4542;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1680, '2026-10-20', 11125, 10750, 10750
                    , 10750, 10750, 10750, 10750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 25, 0, 10750, 10750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11125, sellCostBuyPrice =sellCostBuyPrice+10750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+25
                        , netQuantityRet = netQuantityRet+0;
 INSERT 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-20', 11125, 10750, 10750
                    , 10750, 10750, 10750, 10750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10750, 10750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+11125, sellCostBuyPrice =sellCostBuyPrice+10750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+10750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+10750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+10750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+10750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+10750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+10750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+10750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '17', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2692';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1680', '1', '25', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '42', '17', '1', '2026-10-20 19:19:19','0','0'); -- id=15490
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+12 where id = 508;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01681', '1133', '2', '1681', '12.00', '435', '5220', '0', '', '0', '2026-10-20 19:19:19', '1681', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','508-12,','1','1','0','0','435','5220','0','','0','0.00','0','0','0','0'); -- id=4543
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 = 4543;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1681, '2026-10-20', 5220, 5040, 5040
                    , 5040, 5040, 5040, 5040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 12, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5220, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 5220, 5040, 5040
                    , 5040, 5040, 5040, 5040
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5040, 5040, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+5220, sellCostBuyPrice =sellCostBuyPrice+5040
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+5040, sellCostMeanBuyPrice = sellCostMeanBuyPrice+5040
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+5040, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+5040
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+5040
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+5040
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+5040
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '2693';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1681', '1', '12', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '24', '12', '1', '2026-10-20 19:19:19','0','0'); -- id=15491
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+10 where id = 39;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','01347', '1133', '31', '1347', '10.00', '495', '4950', '0', '', '0', '2026-10-20 19:19:19', '1347', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','39-10,','1','1','0','0','495','4950','0','','0','0.00','0','0','0','0'); -- id=4544
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 = 4544;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1347, '2026-10-20', 4950, 4750, 4750
                    , 4750, 4750, 4750, 4750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 10, 0, 4750, 4750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4950, sellCostBuyPrice =sellCostBuyPrice+4750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 4950, 4750, 4750
                    , 4750, 4750, 4750, 4750
                    , 0, 0, 0, 0
                    , 0, 0, 0, 4750, 4750, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+4950, sellCostBuyPrice =sellCostBuyPrice+4750
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+4750, sellCostMeanBuyPrice = sellCostMeanBuyPrice+4750
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+4750, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+4750
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+4750
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+4750
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+4750
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1347';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1347', '1', '10', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '30', '20', '1', '2026-10-20 19:19:19','0','0'); -- id=15492
UPDATE buypriceshistorybook set sellQuantity = sellQuantity+35 where id = 6711;
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,colorid,onlineOrderId,pricetypepro,playstationPlayId,soldSerialsInDetails,buyPricesHistoryBookIdQuantity,proHeight,proWidth,lastbuyprice_withTax,meanbuyprice_withTax,sellbilldetailpriceC,sellbilldetailtotalpriceC,discountvalueC,proSellTrackingSerial,travelBrokerId,categorydiscount,lastbuyprice_withDiscountAndTax,prosellDiscountPer,prosellDiscountPerType,prosellDiscountVal) VALUES ('265','09693', '1133', '40', '1133', '35.00', '295', '10325', '0', '', '0', '2026-10-20 19:19:19', '1133', '0.00', '0', '1','0.00','','','0','0','0','0','0','0','0','0','','6711-35,','1','1','0','0','295','10325','0','','0','0.00','0','0','0','0'); -- id=4545
UPDATE sellbilldetail SET  lastbuyprice = 265.00 , meanbuyprice = 265.48, lastbuyprice_withDiscount = 265.00, meanbuyprice_withDiscount = 265.48
        , lastbuyprice_withTax = 265, meanbuyprice_withTax = 265.48, lastbuyprice_withDiscountAndTax = 265
                where sellbilldetailid = 4545;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1133, '2026-10-20', 10325, 9275, 9275
                    , 9291.8, 9275, 9291.8, 9275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 35, 0, 9275, 9291.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10325, sellCostBuyPrice =sellCostBuyPrice+9275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9291.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9291.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9291.8
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0
                        , netQuantity = netQuantity+35
                        , netQuantityRet = netQuantityRet+0;
 INSERT INTO quickprofitstore (storeId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1, '2026-10-20', 10325, 9275, 9275
                    , 9291.8, 9275, 9291.8, 9275
                    , 0, 0, 0, 0
                    , 0, 0, 0, 9275, 9291.8, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+10325, sellCostBuyPrice =sellCostBuyPrice+9275
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+9275, sellCostMeanBuyPrice = sellCostMeanBuyPrice+9291.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+9275, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+9291.8
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+9275
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+9275
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+9291.8
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = returnSellCostLastBuyPrice+0
                        , returnSellCostMeanBuyPrice = returnSellCostMeanBuyPrice+0, returnSellCostLastBuyPricewithDiscount = returnSellCostLastBuyPricewithDiscount+0
                        , returnSellCostMeanBuyPricewithDiscount = returnSellCostMeanBuyPricewithDiscount+0
                            , returnSellCostOverAllAveragePrice = returnSellCostOverAllAveragePrice+0
                            , returnSellCostLastBuyPricewithTax = returnSellCostLastBuyPricewithTax+0
                            , returnSellCostMeanBuyPricewithTax = returnSellCostMeanBuyPricewithTax+0;
UPDATE storedetail SET  productquantity = '795', userid = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1133';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1133', '1', '35', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '830', '795', '1', '2026-10-20 19:19:19','0','0'); -- id=15493
INSERT INTO sellbilldetail (buyprice, parcode, sellbillid, sellbilldetailcatid, sellbilldetailproductid, sellbilldetailquantity, sellbilldetailprice, sellbilldetailtotalprice, discountvalue, note, pricetype, sellbilldetaildate, productunitid, buydiscount, buydiscounttype,storeid,discounttype,lastbuyprice,meanbuyprice,lastbuyprice_withDiscount,meanbuyprice_withDiscount,otherdetailquantity,sizeid,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','09231', '1133', '2', '1004', '5.00', '410', '2050', '0', '', '0', '2026-10-20 19:19:19', '1004', '0.00', '-1', '1','0.00','','','0','0','0','0','0','0','0','0','','','1','1','0','0','410','2050','0','','0','0.00','0','0','0','0'); -- id=4546
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 = 4546;
 INSERT INTO quickprofitproduct (productId, theDate, sellVal, sellCostBuyPrice, sellCostLastBuyPrice, sellCostMeanBuyPrice, sellCostLastBuyPricewithDiscount, sellCostMeanBuyPricewithDiscount, sellCostOverAllAveragePrice, returnSellVal, returnSellCostBuyPrice, returnSellCostLastBuyPrice, returnSellCostMeanBuyPrice, returnSellCostLastBuyPricewithDiscount, returnSellCostMeanBuyPricewithDiscount, returnSellCostOverAllAveragePrice,netQuantity,netQuantityRet,sellCostLastBuyPricewithTax,sellCostMeanBuyPricewithTax,returnSellCostLastBuyPricewithTax,returnSellCostMeanBuyPricewithTax)
                    VALUES (1004, '2026-10-20', 2050, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 5, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2050, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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-20', 2050, 1950, 1950
                    , 1950, 1950, 1950, 1950
                    , 0, 0, 0, 0
                    , 0, 0, 0, 1950, 1950, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+2050, sellCostBuyPrice =sellCostBuyPrice+1950
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+1950, sellCostMeanBuyPrice = sellCostMeanBuyPrice+1950
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+1950, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+1950
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+1950
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+1950
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+1950
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+0, returnSellCostLastBuyPrice = 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 = '1', storedetaildate = '2026-10-20 19:19:19' WHERE storedetailid = '1004';
INSERT INTO storereport (productid, storeid, productquantity, storereporttype, storereportmodelid, processname, tablename, productbefore, productafter, userid, storereportdate,sizeid,colorid) VALUES ('1004', '1', '5', '1', '1133', 'اضافة فاتورة مبيعات (معدله)', 'sellbillController.php', '21', '16', '1', '2026-10-20 19:19:19','0','0'); -- id=15494
UPDATE dailyentry SET totalcreditor = '200980.00', totaldebtor = '200980.00', thedate = '2026-10-19', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-19 22:05:39', entryComment = 'اضافة فاتورة مبيعات رقم 1091', fromFlag = '1',related='0',isopeningentry='0',operationId='1091',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=1091' WHERE id = '3900';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '200980.00', '200980.00', '2026-10-20', '1', '0', '3900', '2026-10-20 19:19:19','تم عكس القيد رقم 3900 ','1','0','0','0','0',''); -- id=4022
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4022', '419', '200980.00', '','0'); -- id=4024
UPDATE accountstree SET name = 'خزنة كاشير ', customName = 'خزنة كاشير ', customNameEn = 'خزنة كاشير ', nameEn = 'خزنة كاشير ', parent = '40', accountNature = '0', theValue = '6858083', 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 ('4022', '143', '200980.00', '','0'); -- id=4128
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12568590', 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';
UPDATE dailyentry SET totalcreditor = '181942.40', totaldebtor = '181942.40', thedate = '2026-10-19', userid = '2', `condition` = '0', reverseofid = '-10', dDateTime = '2026-10-19 22:05:39', entryComment = 'اضافة فاتورة مبيعات رقم 1091 - صرف البضاعة من المخزن', fromFlag = '1',related='0',isopeningentry='0',operationId='1091',operationDetailLink='sellbillController.php?do=showDetail&sellbillid=1091' WHERE id = '3901';
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '181942.40', '181942.40', '2026-10-20', '1', '0', '3901', '2026-10-20 19:19:19','تم عكس القيد رقم 3901 ','1','0','0','0','0',''); -- id=4023
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4023', '402', '181942.40', '','0'); -- id=4025
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11634365.21', 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 dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4023', '382', '181942.40', '','0'); -- id=4129
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24590139.49', 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 ( '200980', '200980', '2026-10-20', '1', '0', '0', '2026-10-20 19:19:19','اضافة فاتورة مبيعات رقم 1133','1','0',null,'0','1133','sellbillController.php?do=showDetail&sellbillid=1133'); -- id=4024
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4024', '515', '200980', '','0'); -- id=4130
UPDATE accountstree SET name = 'عنتر - العملاء', customName = 'عنتر - العملاء', customNameEn = 'عنتر - العملاء', nameEn = 'عنتر - العملاء', parent = '58', accountNature = '0', theValue = '209830', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Equity ', userid = '1', del = '0', sysdate = '2026-10-01 21:23:05' WHERE id = '515';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4024', '143', '200980', '','0'); -- id=4026
UPDATE accountstree SET name = 'ايرادات المبيعات ', customName = 'ايرادات المبيعات ', customNameEn = 'Revenue of Sales', nameEn = 'Revenue of Sales', parent = '142', accountNature = '1', theValue = '12769570', 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 ( '181942.4', '181942.4', '2026-10-20', '1', '0', '0', '2026-10-20 19:19:19','اضافة فاتورة مبيعات رقم 1133 - صرف البضاعة من المخزن','1','0',null,'0','1133','sellbillController.php?do=showDetail&sellbillid=1133'); -- id=4025
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4025', '402', '181942.4', '','0'); -- id=4131
UPDATE accountstree SET name = 'تكلفة التشغيل', customName = 'تكلفة التشغيل', customNameEn = '', nameEn = '', parent = '160', accountNature = '0', theValue = '11816307.61', 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 ('4025', '382', '181942.4', '','0'); -- id=4027
UPDATE accountstree SET name = 'مخزن1', customName = 'المخزن الرئيسي', customNameEn = 'مخزن1', nameEn = 'مخزن1', parent = '49', accountNature = '0', theValue = '24408197.09', 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='4024,0,4025' where sellbillid=1133;
 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-20', 200980, 189151, 189151
                    , 189167.8, 181942.4, 183223.73, 181942.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,189151, 171295.18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200980, sellCostBuyPrice =sellCostBuyPrice+189151
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+189151, sellCostMeanBuyPrice = sellCostMeanBuyPrice+189167.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+181942.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+183223.73
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+181942.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+189151
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+171295.18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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 (17, '2026-10-20', 200980, 189151, 189151
                    , 189167.8, 181942.4, 183223.73, 181942.4
                    , 0, 0, 0, 0
                    , 0, 0, 0 ,189151, 171295.18, 0, 0)
                ON DUPLICATE KEY UPDATE sellVal = sellVal+200980, sellCostBuyPrice =sellCostBuyPrice+189151
                        , sellCostLastBuyPrice = sellCostLastBuyPrice+189151, sellCostMeanBuyPrice = sellCostMeanBuyPrice+189167.8
                        , sellCostLastBuyPricewithDiscount = sellCostLastBuyPricewithDiscount+181942.4, sellCostMeanBuyPricewithDiscount = sellCostMeanBuyPricewithDiscount+183223.73
                            , sellCostOverAllAveragePrice = sellCostOverAllAveragePrice+181942.4
                            , sellCostLastBuyPricewithTax = sellCostLastBuyPricewithTax+189151
                            , sellCostMeanBuyPricewithTax = sellCostMeanBuyPricewithTax+171295.18
                        , returnSellVal = returnSellVal+0, returnSellCostBuyPrice = returnSellCostBuyPrice+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, 200980, 189151, 189151
                    , 189167.8, 181942.4, 183223.73, 181942.4, 189151, 171295.18)
                ON DUPLICATE KEY UPDATE netSellVal = netSellVal+200980, netSellCostBuyPrice = netSellCostBuyPrice+189151
                , netSellCostLastBuyPrice = netSellCostLastBuyPrice+189151
                , netSellCostMeanBuyPrice = netSellCostMeanBuyPrice+189167.8
                , netSellCostLastBuyPricewithDiscount = netSellCostLastBuyPricewithDiscount+181942.4
                , netSellCostMeanBuyPricewithDiscount = netSellCostMeanBuyPricewithDiscount+183223.73
                , netSellCostOverAllAveragePrice = netSellCostOverAllAveragePrice+181942.4
                , netSellCostLastBuyPricewithTax = netSellCostLastBuyPricewithTax+189151
                , netSellCostMeanBuyPricewithTax = netSellCostMeanBuyPricewithTax+171295.18;
COMMIT;

-- ----------------------------------------------------------------------------------------------------
-- bill update end - new add end - with oldid = 1091 and newid=1133 and controlname = sellbillController
-- ----------------------------------------------------------------------------------------------------

UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 15:49:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:19:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:19:19', '1', 'editprint', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=editprint&id=1133'); -- id=15883
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:04:41";
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-20 16:04:53";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:34:53", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 19:34:53', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15884
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-20 16:04:53";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 19:34:53', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15885
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:05:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:35:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:35:00', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=15886
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:05:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:35:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('sellbillController.php', '2026-10-20 19:35:02', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/sellbillController.php?do=show'); -- id=15887
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:09:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:39:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2026-10-20 19:39:22', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnsellbillController.php?do=show'); -- id=15888
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:09:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:39:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('returnsellbillController.php', '2026-10-20 19:39:23', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/returnsellbillController.php?do=show'); -- id=15889
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:42:03', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15890
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:42:22', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15891
BEGIN;
CALL supplierInUse(168,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('168', '37500.00', '15000', '1', 'ايصال دفع لمورد', '1', '22500', '2026-10-20 19:42:03', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','15000','1','0','0','0','155',''); -- id=768
UPDATE supplierdebtchange SET supplierid = '168', supplierdebtchangebefore = '37500.00', supplierdebtchangeamount = '15000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '22500', supplierdebtchangedate = '2026-10-20 19:42:03', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='15000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='37500',debtchangamountInSupplierCurrency='15000',debtchangafterInSupplierCurrency='22500', paySerialNo='155',tagids='' WHERE supplierdebtchangeid = '768';
UPDATE supplier SET  suppliercurrentDebt = '22500',suppliercurrentDebtInCurrency= '22500' , userid = '1', supplierdate = '2026-10-20 19:42:22'   WHERE supplierid = '168';
UPDATE supplier SET  inUse = 0 where supplierid = 168;
UPDATE save SET  savecurrentvalue = '-41260306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41245306.00','15000', '1', '1', 'ايصال دفع لمورد', '768', '-41260306', '2026-10-20 19:42:22', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1397
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '15000', '15000', '2026-10-20', '1', '0', '0', '2026-10-20 19:42:22','ايصال دفع لمورد ( كريم كيكي ) ','1','0','0','0','768','supplierReportsController.php?do=show&id=768'); -- id=4026
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4026', '651', '15000', '','0'); -- id=4132
UPDATE accountstree SET name = 'كريم كيكي', customName = 'كريم كيكي', customNameEn = 'كريم كيكي', nameEn = 'كريم كيكي', parent = '81', accountNature = '1', theValue = '22500', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-13 18:56:27' WHERE id = '651';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4026', '383', '15000', '','0'); -- id=4028
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41260309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '168', supplierdebtchangebefore = '37500.00', supplierdebtchangeamount = '15000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '22500.00', supplierdebtchangedate = '2026-10-20 19:42:03', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4026',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='15000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='37500',debtchangamountInSupplierCurrency='15000',debtchangafterInSupplierCurrency='22500', paySerialNo='155',tagids='' WHERE supplierdebtchangeid = '768';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:42:23', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15892
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:42:24', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15893
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:42:24', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15894
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:42:37', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15895
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:42:48', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15896
BEGIN;
CALL supplierInUse(68,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('68', '332915.00', '30000', '1', 'ايصال دفع لمورد', '1', '302915', '2026-10-20 19:42:37', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','156',''); -- id=769
UPDATE supplierdebtchange SET supplierid = '68', supplierdebtchangebefore = '332915.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '302915', supplierdebtchangedate = '2026-10-20 19:42:37', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='332915',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='302915', paySerialNo='156',tagids='' WHERE supplierdebtchangeid = '769';
UPDATE supplier SET  suppliercurrentDebt = '302915',suppliercurrentDebtInCurrency= '302915' , userid = '1', supplierdate = '2026-10-20 19:42:48'   WHERE supplierid = '68';
UPDATE supplier SET  inUse = 0 where supplierid = 68;
UPDATE save SET  savecurrentvalue = '-41290306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41260306.00','30000', '1', '1', 'ايصال دفع لمورد', '769', '-41290306', '2026-10-20 19:42:48', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1398
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-20', '1', '0', '0', '2026-10-20 19:42:48','ايصال دفع لمورد ( بريشكا - مورد ) ','1','0','0','0','769','supplierReportsController.php?do=show&id=769'); -- id=4027
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4027', '487', '30000', '','0'); -- id=4133
UPDATE accountstree SET name = 'بريشكا - مورد', customName = 'بريشكا - مورد', customNameEn = 'بريشكا - مورد', nameEn = 'بريشكا - مورد', parent = '81', accountNature = '1', theValue = '96730', 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 = '487';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4027', '383', '30000', '','0'); -- id=4029
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41290309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '68', supplierdebtchangebefore = '332915.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '302915.00', supplierdebtchangedate = '2026-10-20 19:42:37', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4027',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='332915',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='302915', paySerialNo='156',tagids='' WHERE supplierdebtchangeid = '769';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:48";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:48", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:42:48', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15897
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:42:50', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15898
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:50";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:50", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:42:50', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15899
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:12:52";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:42:52", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:42:52', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15900
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:02', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15901
BEGIN;
CALL supplierInUse(60,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('60', '171580.00', '30000', '1', 'ايصال دفع لمورد', '1', '141580', '2026-10-20 19:42:52', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','157',''); -- id=770
UPDATE supplierdebtchange SET supplierid = '60', supplierdebtchangebefore = '171580.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '141580', supplierdebtchangedate = '2026-10-20 19:42:52', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='171580',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='141580', paySerialNo='157',tagids='' WHERE supplierdebtchangeid = '770';
UPDATE supplier SET  suppliercurrentDebt = '141580',suppliercurrentDebtInCurrency= '141580' , userid = '1', supplierdate = '2026-10-20 19:43:02'   WHERE supplierid = '60';
UPDATE supplier SET  inUse = 0 where supplierid = 60;
UPDATE save SET  savecurrentvalue = '-41320306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41290306.00','30000', '1', '1', 'ايصال دفع لمورد', '770', '-41320306', '2026-10-20 19:43:02', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1399
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-20', '1', '0', '0', '2026-10-20 19:43:02','ايصال دفع لمورد ( ولف وان - مورد ) ','1','0','0','0','770','supplierReportsController.php?do=show&id=770'); -- id=4028
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4028', '479', '30000', '','0'); -- id=4134
UPDATE accountstree SET name = 'ولف وان - مورد', customName = 'ولف وان - مورد', customNameEn = 'ولف وان - مورد', nameEn = 'ولف وان - مورد', parent = '81', accountNature = '1', theValue = '34960', 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 = '479';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4028', '383', '30000', '','0'); -- id=4030
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41320309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '60', supplierdebtchangebefore = '171580.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '141580.00', supplierdebtchangedate = '2026-10-20 19:42:52', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4028',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='171580',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='141580', paySerialNo='157',tagids='' WHERE supplierdebtchangeid = '770';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:04";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:04", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:04', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15902
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:05', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15903
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:05";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:05", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:43:05', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15904
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:07";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:07", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:07', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15905
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:17', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15906
BEGIN;
CALL supplierInUse(41,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('41', '142810.00', '30000', '1', 'ايصال دفع لمورد', '1', '112810', '2026-10-20 19:43:07', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','158',''); -- id=771
UPDATE supplierdebtchange SET supplierid = '41', supplierdebtchangebefore = '142810.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '112810', supplierdebtchangedate = '2026-10-20 19:43:07', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='142810',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='112810', paySerialNo='158',tagids='' WHERE supplierdebtchangeid = '771';
UPDATE supplier SET  suppliercurrentDebt = '112810',suppliercurrentDebtInCurrency= '112810' , userid = '1', supplierdate = '2026-10-20 19:43:17'   WHERE supplierid = '41';
UPDATE supplier SET  inUse = 0 where supplierid = 41;
UPDATE save SET  savecurrentvalue = '-41350306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41320306.00','30000', '1', '1', 'ايصال دفع لمورد', '771', '-41350306', '2026-10-20 19:43:17', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1400
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-20', '1', '0', '0', '2026-10-20 19:43:17','ايصال دفع لمورد ( ابل - مورد ) ','1','0','0','0','771','supplierReportsController.php?do=show&id=771'); -- id=4029
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4029', '460', '30000', '','0'); -- id=4135
UPDATE accountstree SET name = 'ابل - مورد', customName = 'ابل - مورد', customNameEn = 'ابل - مورد', nameEn = 'ابل - مورد', parent = '81', accountNature = '1', theValue = '64959', 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 = '460';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4029', '383', '30000', '','0'); -- id=4031
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41350309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '41', supplierdebtchangebefore = '142810.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '112810.00', supplierdebtchangedate = '2026-10-20 19:43:07', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4029',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='142810',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='112810', paySerialNo='158',tagids='' WHERE supplierdebtchangeid = '771';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:18', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15907
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:19', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15908
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:43:19', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15909
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:20', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15910
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:33', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15911
BEGIN;
CALL supplierInUse(43,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('43', '258596.00', '30000', '1', 'ايصال دفع لمورد', '1', '228596', '2026-10-20 19:43:20', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','159',''); -- id=772
UPDATE supplierdebtchange SET supplierid = '43', supplierdebtchangebefore = '258596.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '228596', supplierdebtchangedate = '2026-10-20 19:43:20', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='692970',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='228596', paySerialNo='159',tagids='' WHERE supplierdebtchangeid = '772';
UPDATE supplier SET  suppliercurrentDebt = '228596',suppliercurrentDebtInCurrency= '228596' , userid = '1', supplierdate = '2026-10-20 19:43:33'   WHERE supplierid = '43';
UPDATE supplier SET  inUse = 0 where supplierid = 43;
UPDATE save SET  savecurrentvalue = '-41380306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41350306.00','30000', '1', '1', 'ايصال دفع لمورد', '772', '-41380306', '2026-10-20 19:43:33', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1401
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-20', '1', '0', '0', '2026-10-20 19:43:33','ايصال دفع لمورد ( فولكانو شروال - مورد ) ','1','0','0','0','772','supplierReportsController.php?do=show&id=772'); -- id=4030
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4030', '462', '30000', '','0'); -- id=4136
UPDATE accountstree SET name = 'فولكانو شروال - مورد', customName = 'فولكانو شروال - مورد', customNameEn = 'فولكانو شروال - مورد', nameEn = 'فولكانو شروال - مورد', parent = '81', accountNature = '1', theValue = '116940', 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 = '462';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4030', '383', '30000', '','0'); -- id=4032
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41380309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '43', supplierdebtchangebefore = '258596.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '228596.00', supplierdebtchangedate = '2026-10-20 19:43:20', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4030',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='692970',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='228596', paySerialNo='159',tagids='' WHERE supplierdebtchangeid = '772';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:33', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15912
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:34', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15913
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:35";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:35", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:43:35', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15914
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:13:36";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:43:36", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:43:36', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15915
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:14:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:44:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:44:58', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15916
BEGIN;
CALL supplierInUse(95,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('95', '241140.00', '50000', '1', 'ايصال دفع لمورد', '1', '191140', '2026-10-20 19:43:36', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','160',''); -- id=773
UPDATE supplierdebtchange SET supplierid = '95', supplierdebtchangebefore = '241140.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '191140', supplierdebtchangedate = '2026-10-20 19:43:36', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='241140',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='191140', paySerialNo='160',tagids='' WHERE supplierdebtchangeid = '773';
UPDATE supplier SET  suppliercurrentDebt = '191140',suppliercurrentDebtInCurrency= '191140' , userid = '1', supplierdate = '2026-10-20 19:44:58'   WHERE supplierid = '95';
UPDATE supplier SET  inUse = 0 where supplierid = 95;
UPDATE save SET  savecurrentvalue = '-41430306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41380306.00','50000', '1', '1', 'ايصال دفع لمورد', '773', '-41430306', '2026-10-20 19:44:58', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1402
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-20', '1', '0', '0', '2026-10-20 19:44:58','ايصال دفع لمورد ( محمد ايمن-الموردين ) ','1','0','0','0','773','supplierReportsController.php?do=show&id=773'); -- id=4031
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4031', '578', '50000', '','0'); -- id=4137
UPDATE accountstree SET name = 'محمد ايمن-الموردين', customName = 'محمد ايمن-الموردين', customNameEn = 'محمد ايمن-الموردين', nameEn = 'محمد ايمن-الموردين', parent = '81', accountNature = '1', theValue = '210238', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-06 19:55:21' WHERE id = '578';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4031', '383', '50000', '','0'); -- id=4033
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41430309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '95', supplierdebtchangebefore = '241140.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '191140.00', supplierdebtchangedate = '2026-10-20 19:43:36', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4031',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='241140',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='191140', paySerialNo='160',tagids='' WHERE supplierdebtchangeid = '773';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:14:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:44:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:44:59', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15917
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:15:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:45:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:45:00', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15918
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:15:00";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:45:00", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:45:00', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15919
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:15:03";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:45:03", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:45:03', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15920
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:12";
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-20 16:16:17";
UPDATE user SET loginip = "105.193.129.42", lastactivetime = "2026-10-20 19:46:17", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('index.php', '2026-10-20 19:46:17', '1', '', '105.193.129.42', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/index.php'); -- id=15921
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-20 16:16:17";
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('playStationCardController.php', '2026-10-20 19:46:17', '1', 'handleExpiredCards', '51.89.20.165', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/playStationCardController.php?do=handleExpiredCards'); -- id=15922
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:18', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15923
BEGIN;
CALL supplierInUse(60,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('60', '141580.00', '10000', '1', 'ايصال دفع لمورد', '1', '131580', '2026-10-20 19:45:03', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','10000','1','0','0','0','161',''); -- id=774
UPDATE supplierdebtchange SET supplierid = '60', supplierdebtchangebefore = '141580.00', supplierdebtchangeamount = '10000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '131580', supplierdebtchangedate = '2026-10-20 19:45:03', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='10000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='141580',debtchangamountInSupplierCurrency='10000',debtchangafterInSupplierCurrency='131580', paySerialNo='161',tagids='' WHERE supplierdebtchangeid = '774';
UPDATE supplier SET  suppliercurrentDebt = '131580',suppliercurrentDebtInCurrency= '131580' , userid = '1', supplierdate = '2026-10-20 19:46:18'   WHERE supplierid = '60';
UPDATE supplier SET  inUse = 0 where supplierid = 60;
UPDATE save SET  savecurrentvalue = '-41440306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41430306.00','10000', '1', '1', 'ايصال دفع لمورد', '774', '-41440306', '2026-10-20 19:46:18', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1403
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '10000', '10000', '2026-10-20', '1', '0', '0', '2026-10-20 19:46:18','ايصال دفع لمورد ( ولف وان - مورد ) ','1','0','0','0','774','supplierReportsController.php?do=show&id=774'); -- id=4032
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4032', '479', '10000', '','0'); -- id=4138
UPDATE accountstree SET name = 'ولف وان - مورد', customName = 'ولف وان - مورد', customNameEn = 'ولف وان - مورد', nameEn = 'ولف وان - مورد', parent = '81', accountNature = '1', theValue = '24960', 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 = '479';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4032', '383', '10000', '','0'); -- id=4034
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41440309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '60', supplierdebtchangebefore = '141580.00', supplierdebtchangeamount = '10000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '131580.00', supplierdebtchangedate = '2026-10-20 19:45:03', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4032',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='10000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='141580',debtchangamountInSupplierCurrency='10000',debtchangafterInSupplierCurrency='131580', paySerialNo='161',tagids='' WHERE supplierdebtchangeid = '774';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:19";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:19", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:19', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15924
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:19";
UPDATE user SET loginip = "105.193.129.42", lastactivetime = "2026-10-20 19:46:19", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierController.php', '2026-10-20 19:46:19', '1', '', '105.193.129.42', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/supplierController.php'); -- id=15925
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:20', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15926
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:20";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:20", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:46:20', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15927
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:22', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15928
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:22";
UPDATE user SET loginip = "105.193.129.42", lastactivetime = "2026-10-20 19:46:22", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:46:22', '1', 'oneSupplier', '105.193.129.42', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15929
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:30";
UPDATE user SET loginip = "105.193.129.42", lastactivetime = "2026-10-20 19:46:30", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:46:30', '1', 'oneSupplier', '105.193.129.42', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php?do=oneSupplier'); -- id=15930
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:32', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15931
BEGIN;
CALL supplierInUse(67,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('67', '48898.50', '30000', '1', 'ايصال دفع لمورد', '1', '18898.5', '2026-10-20 19:46:22', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','162',''); -- id=775
UPDATE supplierdebtchange SET supplierid = '67', supplierdebtchangebefore = '48898.50', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '18898.5', supplierdebtchangedate = '2026-10-20 19:46:22', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='48898.5',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='18898.5', paySerialNo='162',tagids='' WHERE supplierdebtchangeid = '775';
UPDATE supplier SET  suppliercurrentDebt = '18898.5',suppliercurrentDebtInCurrency= '18898.5' , userid = '1', supplierdate = '2026-10-20 19:46:32'   WHERE supplierid = '67';
UPDATE supplier SET  inUse = 0 where supplierid = 67;
UPDATE save SET  savecurrentvalue = '-41470306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41440306.00','30000', '1', '1', 'ايصال دفع لمورد', '775', '-41470306', '2026-10-20 19:46:32', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1404
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-20', '1', '0', '0', '2026-10-20 19:46:32','ايصال دفع لمورد ( نمبر وان - مورد ) ','1','0','0','0','775','supplierReportsController.php?do=show&id=775'); -- id=4033
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4033', '486', '30000', '','0'); -- id=4139
UPDATE accountstree SET name = 'نمبر وان - مورد', customName = 'نمبر وان - مورد', customNameEn = 'نمبر وان - مورد', nameEn = 'نمبر وان - مورد', parent = '81', accountNature = '1', theValue = '-72674.5', 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 = '486';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4033', '383', '30000', '','0'); -- id=4035
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41470309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '67', supplierdebtchangebefore = '48898.50', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '18898.50', supplierdebtchangedate = '2026-10-20 19:46:22', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4033',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='48898.5',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='18898.5', paySerialNo='162',tagids='' WHERE supplierdebtchangeid = '775';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:32";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:32", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:32', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15932
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:33";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:33", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:33', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15933
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:34";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:34", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:46:34', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15934
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:46";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:46", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:46', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15935
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:58', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15936
BEGIN;
CALL supplierInUse(85,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('85', '70389.00', '40000', '1', 'ايصال دفع لمورد', '1', '30389', '2026-10-20 19:46:46', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','40000','1','0','0','0','163',''); -- id=776
UPDATE supplierdebtchange SET supplierid = '85', supplierdebtchangebefore = '70389.00', supplierdebtchangeamount = '40000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '30389', supplierdebtchangedate = '2026-10-20 19:46:46', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='40000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='70389',debtchangamountInSupplierCurrency='40000',debtchangafterInSupplierCurrency='30389', paySerialNo='163',tagids='' WHERE supplierdebtchangeid = '776';
UPDATE supplier SET  suppliercurrentDebt = '30389',suppliercurrentDebtInCurrency= '30389' , userid = '1', supplierdate = '2026-10-20 19:46:58'   WHERE supplierid = '85';
UPDATE supplier SET  inUse = 0 where supplierid = 85;
UPDATE save SET  savecurrentvalue = '-41510306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41470306.00','40000', '1', '1', 'ايصال دفع لمورد', '776', '-41510306', '2026-10-20 19:46:58', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1405
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '40000', '40000', '2026-10-20', '1', '0', '0', '2026-10-20 19:46:58','ايصال دفع لمورد ( زورو ) ','1','0','0','0','776','supplierReportsController.php?do=show&id=776'); -- id=4034
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4034', '565', '40000', '','0'); -- id=4140
UPDATE accountstree SET name = 'زورو', customName = 'زورو', customNameEn = 'زورو', nameEn = 'زورو', parent = '81', accountNature = '1', theValue = '30389', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-05 18:54:50' WHERE id = '565';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4034', '383', '40000', '','0'); -- id=4036
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41510309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '85', supplierdebtchangebefore = '70389.00', supplierdebtchangeamount = '40000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '30389.00', supplierdebtchangedate = '2026-10-20 19:46:46', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4034',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='40000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='70389',debtchangamountInSupplierCurrency='40000',debtchangafterInSupplierCurrency='30389', paySerialNo='163',tagids='' WHERE supplierdebtchangeid = '776';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:58', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15937
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:16:59";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:46:59", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:46:59', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15938
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:01";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:01", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:47:01', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15939
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:02";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:02", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:47:02', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15940
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:03";
UPDATE user SET loginip = "105.193.129.42", lastactivetime = "2026-10-20 19:47:03", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 19:47:03', '1', '', '105.193.129.42', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/storedetailController.php'); -- id=15941
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:15";
UPDATE user SET loginip = "105.193.129.42", lastactivetime = "2026-10-20 19:47:15", deviceType = "MOBILE" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('storedetailController.php', '2026-10-20 19:47:15', '1', 'show', '105.193.129.42', '', 'MOBILE','https://elaraby.gt4it.com/erp/controllers/storedetailController.php?do=show'); -- id=15942
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:47:16', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15943
BEGIN;
CALL supplierInUse(189,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('189', '35680.00', '30000', '1', 'ايصال دفع لمورد', '1', '5680', '2026-10-20 19:47:02', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','164',''); -- id=777
UPDATE supplierdebtchange SET supplierid = '189', supplierdebtchangebefore = '35680.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '5680', supplierdebtchangedate = '2026-10-20 19:47:02', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='35680',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='5680', paySerialNo='164',tagids='' WHERE supplierdebtchangeid = '777';
UPDATE supplier SET  suppliercurrentDebt = '5680',suppliercurrentDebtInCurrency= '5680' , userid = '1', supplierdate = '2026-10-20 19:47:16'   WHERE supplierid = '189';
UPDATE supplier SET  inUse = 0 where supplierid = 189;
UPDATE save SET  savecurrentvalue = '-41540306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41510306.00','30000', '1', '1', 'ايصال دفع لمورد', '777', '-41540306', '2026-10-20 19:47:16', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1406
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-20', '1', '0', '0', '2026-10-20 19:47:16','ايصال دفع لمورد ( تيمو ) ','1','0','0','0','777','supplierReportsController.php?do=show&id=777'); -- id=4035
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4035', '675', '30000', '','0'); -- id=4141
UPDATE accountstree SET name = 'تيمو', customName = 'تيمو', customNameEn = 'تيمو', nameEn = 'تيمو', parent = '81', accountNature = '1', theValue = '5680', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-16 11:58:11' WHERE id = '675';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4035', '383', '30000', '','0'); -- id=4037
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41540309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '189', supplierdebtchangebefore = '35680.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '5680.00', supplierdebtchangedate = '2026-10-20 19:47:02', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4035',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='35680',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='5680', paySerialNo='164',tagids='' WHERE supplierdebtchangeid = '777';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:16";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:16", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:47:16', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15944
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:17";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:17", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:47:17', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15945
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:18";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:18", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:47:18', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15946
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:22";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:22", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:47:22', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15947
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:47:54', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15948
BEGIN;
CALL supplierInUse(143,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('143', '33600.00', '30000', '1', 'ايصال دفع لمورد', '1', '3600', '2026-10-20 19:47:22', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','30000','1','0','0','0','165',''); -- id=778
UPDATE supplierdebtchange SET supplierid = '143', supplierdebtchangebefore = '33600.00', supplierdebtchangeamount = '30000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '3600', supplierdebtchangedate = '2026-10-20 19:47:22', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='33600',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='3600', paySerialNo='165',tagids='' WHERE supplierdebtchangeid = '778';
UPDATE supplier SET  suppliercurrentDebt = '3600',suppliercurrentDebtInCurrency= '3600' , userid = '1', supplierdate = '2026-10-20 19:47:54'   WHERE supplierid = '143';
UPDATE supplier SET  inUse = 0 where supplierid = 143;
UPDATE save SET  savecurrentvalue = '-41570306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41540306.00','30000', '1', '1', 'ايصال دفع لمورد', '778', '-41570306', '2026-10-20 19:47:54', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1407
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '30000', '30000', '2026-10-20', '1', '0', '0', '2026-10-20 19:47:54','ايصال دفع لمورد ( بلس ) ','1','0','0','0','778','supplierReportsController.php?do=show&id=778'); -- id=4036
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4036', '626', '30000', '','0'); -- id=4142
UPDATE accountstree SET name = 'بلس', customName = 'بلس', customNameEn = 'بلس', nameEn = 'بلس', parent = '81', accountNature = '1', theValue = '3600', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-09 21:21:17' WHERE id = '626';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4036', '383', '30000', '','0'); -- id=4038
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41570309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '143', supplierdebtchangebefore = '33600.00', supplierdebtchangeamount = '30000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '3600.00', supplierdebtchangedate = '2026-10-20 19:47:22', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4036',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='30000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='33600',debtchangamountInSupplierCurrency='30000',debtchangafterInSupplierCurrency='3600', paySerialNo='165',tagids='' WHERE supplierdebtchangeid = '778';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:54";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:54", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:47:54', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15949
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:47:56', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15950
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:56";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:56", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:47:56', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15951
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:17:58";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:47:58", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:47:58', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15952
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:08', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15953
BEGIN;
CALL supplierInUse(177,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('177', '77430.00', '50000', '1', 'ايصال دفع لمورد', '1', '27430', '2026-10-20 19:47:58', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','50000','1','0','0','0','166',''); -- id=779
UPDATE supplierdebtchange SET supplierid = '177', supplierdebtchangebefore = '77430.00', supplierdebtchangeamount = '50000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '27430', supplierdebtchangedate = '2026-10-20 19:47:58', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='77430',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='27430', paySerialNo='166',tagids='' WHERE supplierdebtchangeid = '779';
UPDATE supplier SET  suppliercurrentDebt = '27430',suppliercurrentDebtInCurrency= '27430' , userid = '1', supplierdate = '2026-10-20 19:48:08'   WHERE supplierid = '177';
UPDATE supplier SET  inUse = 0 where supplierid = 177;
UPDATE save SET  savecurrentvalue = '-41620306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41570306.00','50000', '1', '1', 'ايصال دفع لمورد', '779', '-41620306', '2026-10-20 19:48:08', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1408
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '50000', '50000', '2026-10-20', '1', '0', '0', '2026-10-20 19:48:08','ايصال دفع لمورد ( فيوتشر الشيخ السلام ) ','1','0','0','0','779','supplierReportsController.php?do=show&id=779'); -- id=4037
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4037', '660', '50000', '','0'); -- id=4143
UPDATE accountstree SET name = 'فيوتشر الشيخ السلام', customName = 'فيوتشر الشيخ السلام', customNameEn = 'فيوتشر الشيخ السلام', nameEn = 'فيوتشر الشيخ السلام', parent = '81', accountNature = '1', theValue = '27430', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-14 21:09:02' WHERE id = '660';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4037', '383', '50000', '','0'); -- id=4039
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41620309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '177', supplierdebtchangebefore = '77430.00', supplierdebtchangeamount = '50000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '27430.00', supplierdebtchangedate = '2026-10-20 19:47:58', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4037',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='50000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='77430',debtchangamountInSupplierCurrency='50000',debtchangafterInSupplierCurrency='27430', paySerialNo='166',tagids='' WHERE supplierdebtchangeid = '779';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:08";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:08", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:08', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15954
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:10', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15955
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:10";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:10", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:48:10', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15956
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:13";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:13", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:13', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15957
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:23', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15958
BEGIN;
CALL supplierInUse(17,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('17', '91088.00', '25000', '1', 'ايصال دفع لمورد', '1', '66088', '2026-10-20 19:48:13', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','25000','1','0','0','0','167',''); -- id=780
UPDATE supplierdebtchange SET supplierid = '17', supplierdebtchangebefore = '91088.00', supplierdebtchangeamount = '25000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '66088', supplierdebtchangedate = '2026-10-20 19:48:13', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='25000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='625275',debtchangamountInSupplierCurrency='25000',debtchangafterInSupplierCurrency='66088', paySerialNo='167',tagids='' WHERE supplierdebtchangeid = '780';
UPDATE supplier SET  suppliercurrentDebt = '66088',suppliercurrentDebtInCurrency= '66088' , userid = '1', supplierdate = '2026-10-20 19:48:23'   WHERE supplierid = '17';
UPDATE supplier SET  inUse = 0 where supplierid = 17;
UPDATE save SET  savecurrentvalue = '-41645306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41620306.00','25000', '1', '1', 'ايصال دفع لمورد', '780', '-41645306', '2026-10-20 19:48:23', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1409
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '25000', '25000', '2026-10-20', '1', '0', '0', '2026-10-20 19:48:23','ايصال دفع لمورد ( المعلم - مورد ) ','1','0','0','0','780','supplierReportsController.php?do=show&id=780'); -- id=4038
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4038', '436', '25000', '','0'); -- id=4144
UPDATE accountstree SET name = 'المعلم - مورد', customName = 'المعلم - مورد', customNameEn = 'المعلم - مورد', nameEn = 'المعلم - مورد', parent = '81', accountNature = '1', theValue = '54245', 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 = '436';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4038', '383', '25000', '','0'); -- id=4040
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41645309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '17', supplierdebtchangebefore = '91088.00', supplierdebtchangeamount = '25000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '66088.00', supplierdebtchangedate = '2026-10-20 19:48:13', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4038',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='25000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='625275',debtchangamountInSupplierCurrency='25000',debtchangafterInSupplierCurrency='66088', paySerialNo='167',tagids='' WHERE supplierdebtchangeid = '780';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:23";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:23", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:23', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15959
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:24";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:24", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:24', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15960
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:25";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:25", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:48:25', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15961
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:26";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:26", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:26', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php'); -- id=15962
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:37', '1', 'add', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=add'); -- id=15963
BEGIN;
CALL supplierInUse(161,@supplierdebt,@suppliername,@dailyentryid,@treeIdis);
INSERT INTO supplierdebtchange (supplierid, supplierdebtchangebefore, supplierdebtchangeamount, supplierdebtchangetype, processname, supplierdebtchangemodelid, supplierdebtchangeafter, supplierdebtchangedate, userid, tablename, comment, dailyentryid,saveid, costcenterid,currencyId,conversionFactor,payedInCurrency,saveConversionFactor,debtchangbeforeInSupplierCurrency,debtchangamountInSupplierCurrency,debtchangafterInSupplierCurrency,paySerialNo,tagids) VALUES ('161', '594663.00', '300000', '1', 'ايصال دفع لمورد', '1', '294663', '2026-10-20 19:48:26', '1', 'supplierPayedDeptController.php', '', '0','1', '-1','1','1','300000','1','0','0','0','168',''); -- id=781
UPDATE supplierdebtchange SET supplierid = '161', supplierdebtchangebefore = '594663.00', supplierdebtchangeamount = '300000', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '294663', supplierdebtchangedate = '2026-10-20 19:48:26', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '0',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='300000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='594663',debtchangamountInSupplierCurrency='300000',debtchangafterInSupplierCurrency='294663', paySerialNo='168',tagids='' WHERE supplierdebtchangeid = '781';
UPDATE supplier SET  suppliercurrentDebt = '294663',suppliercurrentDebtInCurrency= '294663' , userid = '1', supplierdate = '2026-10-20 19:48:37'   WHERE supplierid = '161';
UPDATE supplier SET  inUse = 0 where supplierid = 161;
UPDATE save SET  savecurrentvalue = '-41945306',  userid = '1' WHERE saveid = '1';
INSERT INTO savedaily (savedailysavebefore, savedailychangeamount, savedailychangetype, saveid, processname, savedailymodelid, savedailysaveafter, savedailydate, userid, tablename,clientid ,note,clientdebtchangeidfk) VALUES ('-41645306.00','300000', '1', '1', 'ايصال دفع لمورد', '781', '-41945306', '2026-10-20 19:48:37', '1',  'supplierPayedDeptController.php','0','','0'); -- id=1410
INSERT INTO dailyentry (totalcreditor, totaldebtor, thedate, userid, `condition`, reverseofid, dDateTime,entryComment,fromFlag,related,branchid,isopeningentry,operationId,operationDetailLink) VALUES ( '300000', '300000', '2026-10-20', '1', '0', '0', '2026-10-20 19:48:37','ايصال دفع لمورد ( الالماني ) ','1','0','0','0','781','supplierReportsController.php?do=show&id=781'); -- id=4039
INSERT INTO dailyentrydebtor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4039', '644', '300000', '','0'); -- id=4145
UPDATE accountstree SET name = 'الالماني', customName = 'الالماني', customNameEn = 'الالماني', nameEn = 'الالماني', parent = '81', accountNature = '1', theValue = '294663', theOrder = '0', layingOrder = '', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '1', itemtype2 = '1', itemtype3 = '', userid = '1', del = '0', sysdate = '2026-10-12 18:57:07' WHERE id = '644';
INSERT INTO dailyentrycreditor (dailyentryid, accountstreeid, value, dComment,costcenterid) VALUES ('4039', '383', '300000', '','0'); -- id=4041
UPDATE accountstree SET name = 'الخزنة الرئيسية', customName = 'الخزنة الرئيسية', customNameEn = 'الخزنة الرئيسية', nameEn = 'الخزنة الرئيسية', parent = '40', accountNature = '0', theValue = '-41945309.8', theOrder = '0', layingOrder = '12010200002', reportid = '1', listId = '1', notes = '', itemfrom = '0', itemtype = '3', itemtype2 = '1', itemtype3 = 'Bank and Cash ', userid = '1', del = '0', sysdate = '2022-05-08 23:12:28' WHERE id = '383';
UPDATE supplierdebtchange SET supplierid = '161', supplierdebtchangebefore = '594663.00', supplierdebtchangeamount = '300000.00', supplierdebtchangetype = '1', processname = 'ايصال دفع لمورد', supplierdebtchangemodelid = '1', supplierdebtchangeafter = '294663.00', supplierdebtchangedate = '2026-10-20 19:48:26', userid = '1', tablename = 'supplierPayedDeptController.php', comment = '', dailyentryid = '4039',saveid = '1',currencyId='1',conversionFactor='1',payedInCurrency='300000',saveConversionFactor='1',debtchangbeforeInSupplierCurrency='594663',debtchangamountInSupplierCurrency='300000',debtchangafterInSupplierCurrency='294663', paySerialNo='168',tagids='' WHERE supplierdebtchangeid = '781';
COMMIT;
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:37";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:37", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:37', '1', 'sucess', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=sucess'); -- id=15964
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:38";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:38", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierPayedDeptController.php', '2026-10-20 19:48:38', '1', 'show', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierPayedDeptController.php?do=show'); -- id=15965
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 16:18:39";
UPDATE user SET loginip = "41.42.136.168", lastactivetime = "2026-10-20 19:48:39", deviceType = "DESKTOP" WHERE userid = 1;
INSERT INTO movementmanage (operationname, movementmanagedate, userid, currentDo, ip, mac, deviceType,completeURL) VALUES ('supplierReportsController.php', '2026-10-20 19:48:39', '1', '', '41.42.136.168', '', 'DESKTOP','https://elaraby.gt4it.com/erp/controllers/supplierReportsController.php'); -- id=15966
UPDATE user SET loginip = "" WHERE lastactivetime < "2026-10-20 19:32:06";
